text:
.icon-arrowUp{
    background:url(icons/arrowUp.png) no-repeat;
}
.icon-arrowDown{
    background:url(icons/arrowDown.png) no-repeat;
}
.icon-notEssence{
    background:url(icons/notEssence.png) no-repeat;
}
.icon-essence{
    background:url(icons/essence.png) no-repeat;
}
.icon-report{
    background:url(icons/report.png) no-repeat;
}
.icon-excel{
    background:url(icons/excel.png) no-repeat;
}
.icon-pdf{
    background:url(icons/pdf.png) no-repeat;
}

.icon-btn{
	background:url(icons/button.png) no-repeat;
}
.icon-clear{
    background:url(icons/clear.png) no-repeat;
}

.icon-error{
	background:url(icons/error.png) no-repeat;
}

.icon-task{
	background:url(icons/task.png) no-repeat;
}

.icon-reset{
    background:url(icons/reset.png) no-repeat;
}
.icon-debug{
	background:url(icons/debug.png) no-repeat;
}

.icon-var{
    background:url(icons/var.png) no-repeat;
}

.icon-scripts{
    background:url(icons/scripts.png) no-repeat;
}

.icon-read{
    background:url(icons/read.png) no-repeat;
}

.icon-hide{
    background:url(icons/hide.png) no-repeat;
}

.icon-doc{
    background:url(icons/doc.png) no-repeat;
}
.icon-help{
    background:url(icons/help.png) no-repeat;
}
.icon-parameter{
    background:url(icons/parameter.png) no-repeat;
}
.icon-oddraft{
    background:url(icons/icon-oddraft.png) no-repeat;
}
.icon-reportView{
    background:url(icons/report-view.png) no-repeat;
}
.icon-publish{
    background:url(icons/publish.png) no-repeat;
}
.icon-emailAdd{
    background:url(icons/email_add.png) no-repeat;
}

.icon-group{
    background:url(icons/group.png) no-repeat;
}
.icon-newMsg{
    background:url(icons/mail.png) no-repeat;
}
.icon-readedMsg{
    background:url(icons/mail_open.png) no-repeat;
}
.icon-to-receive{
    background:url(icons/icon-to-receive.png) no-repeat;
}

.icon-export{
	background:url(icons/export.png) no-repeat;
}

.icon-import{
	background:url(icons/import.png) no-repeat;
}

.icon-sendMsg{
    background:url(icons/msg_send.png) no-repeat;
}
.icon-addMsgPerson{
    background:url(icons/people_add.png) no-repeat;
}
.icon-addMsgGroup{
    background:url(icons/group_add.png) no-repeat;
}
.icon-mailDown{
    background:url(icons/mail_light_down.png) no-repeat;
}
.icon-mailUp{
    background:url(icons/mail_light_up.png) no-repeat;
}

.icon-home{
    background:url(icons/home.png) no-repeat;
}
.icon-next{
    background:url(icons/next.gif) no-repeat;
}

.icon-prev{
    background:url(icons/prev.gif) no-repeat;
}

.icon-detail{
    background:url(icons/detail.png) no-repeat;
}

.icon-edit{
    background:url(icons/edit.png) no-repeat;
}

.icon-form{
    background:url(icons/form.png) no-repeat;
}

.icon-create{
    background:url(icons/add.png) no-repeat;
}

.icon-info{
	background:url(icons/info.png) no-repeat;
}

.icon-copyAdd{
    background:url(icons/copyAdd.png) no-repeat;
}

.icon-search{
    background:url(icons/search.png) no-repeat;
}

.icon-addSearch{
    background:url(icons/addSearch.png) no-repeat;
}

.icon-delSearch{
    background:url(icons/delSearch.png) no-repeat;
}

.icon-loadSearch{
    background:url(icons/loadSearch.png) no-repeat;
}

.icon-attach{
    background:url(icons/attach.png) no-repeat;
}
.icon-myword{
    background:url(icons/icon-myword.png) no-repeat;
}
.icon-myexcel{
    background:url(icons/icon-myexcel.png) no-repeat;
}
.icon-myppt{
    background:url(icons/icon-myppt.png) no-repeat;
}

.icon-attachAdd{
    background:url(icons/attachAdd.png) no-repeat;
}

.icon-preview{
    background:url(icons/preview.png) no-repeat;
}

.icon-download{
    background:url(icons/download.png) no-repeat;
}

.icon-printer{
    background:url(icons/printer.png) no-repeat;
}

.icon-excel{
    background:url(icons/excel.gif) no-repeat;
}

.icon-archives{
    background:url(icons/archives.png) no-repeat;
}

.icon-setting{
    background:url(icons/setting.png) no-repeat;
}

.icon-saveAll{
    background:url(icons/save_all.png) no-repeat;
}

.icon-refresh{
    background:url(icons/refresh.png) no-repeat;
}

.icon-select{
    background:url(icons/select.png) no-repeat ;
}

.icon-rowafter{
	 background:url(icons/arrow_turn_right.png) no-repeat ;
}
.icon-rowbefore{
	 background:url(icons/arrow_turn_left.png) no-repeat ;
}

.icon-lock{
	 background:url(icons/lock.png) no-repeat ;
}

.icon-unlock{
	 background:url(icons/unlock.png) no-repeat ;
}

.icon-org-set{
	 background:url(icons/org-set.png) no-repeat ;
}

.icon-tab-com{
	background:url(icons/tab-com.png) no-repeat;
}

.icon-relation{
	background:url(icons/relation.png) no-repeat;
}

.icon-dimension{
	background:url(icons/dimension.png) no-repeat;
}

.icon-user-button .mini-buttonedit-icon{
	background:url(icons/user.png) no-repeat;
}

.icon-group-button .mini-buttonedit-icon{
	background:url(icons/groups.png) no-repeat;
}

.icon-dep-button .mini-buttonedit-icon{
	background:url(icons/department.png) no-repeat;
}

.icon-groups{
	background:url(icons/groups.png) no-repeat;
}

.icon-department{
	background:url(icons/department.png) no-repeat;
}

.icon-calendar{
	background:url(icons/calendar.png) no-repeat;
}

.icon-flow{
	background:url(icons/flow.png) no-repeat;
}

.icon-up{
	background:url(icons/up.png) no-repeat;
}

.icon-down{
	background:url(icons/down.png) no-repeat;
}

.icon-account{
	background:url(icons/account.png) no-repeat;
}

.icon-rank{
	background:url(icons/rank.png) no-repeat;
}

.icon-modify-pwd{
	background:url(icons/modify-pwd.png) no-repeat;
}

.icon-grant{
	background:url(icons/icon-grant.png) no-repeat;
}

.icon-grant-to{
	background:url(icons/grant-to.png) no-repeat;
}

.icon-window{
	background:url(icons/icon-window.png) no-repeat;
}

.icon-system{
	background:url(icons/icon-system.png) no-repeat;
}

.icon-window2{
	background:url(icons/icon-window2.png) no-repeat;
}

.icon-check{
	background:url(icons/check.png) no-repeat;
}

.icon-uncheck{
	background:url(icons/uncheck.png) no-repeat;
}

.icon-col-news{
	background:url(icons/col-news.png) no-repeat;
}

.icon-flow-design{
	background:url(icons/flow-design.png) no-repeat;
}

.icon-flow-deploy{
	background:url(icons/icon-deploy.png) no-repeat;
}

.icon-version{
	background:url(icons/version.png) no-repeat;
}

.icon-main{
	background:url(icons/main.png) no-repeat;
}

.icon-script{
	background:url(icons/script.png) no-repeat;
}

.icon-mgr{
	background:url(icons/mgr.png) no-repeat;
}

.icon-xml{
	background:url(icons/xml.png) no-repeat;
}

.icon-start{
	background:url(icons/icon-start.png) no-repeat;
}

.icon-btn-mgr{
	background:url(icons/btn-mgr.png) no-repeat;
}

.icon-office{
	background:url(icons/office.png) no-repeat;
}

.icon-document{
	background:url(icons/document.png) no-repeat;
}

.icon-activate{
	background:url(icons/activate.png) no-repeat;
}

.icon-suspend{
	background:url(icons/suspend.png) no-repeat;
}

.icon-end{
	background:url(icons/end.png) no-repeat;
}

.icon-move{
	background:url(icons/transfer1.png) no-repeat;
}

.icon-commute{
	background:url(icons/commute.png) no-repeat;
}

.icon-ch-user{
		background:url(icons/user.png) no-repeat;
}

.icon-handle{
	background:url(icons/handle.png) no-repeat;
}

.icon-flow-img{
	background:url(icons/flow-img.png) no-repeat;
}

.icon-monitor{
	background:url(icons/monitor.png) no-repeat;
}

.icon-transfer{
	background:url(icons/transfer.png) no-repeat;
}

.icon-back{
	background:url(icons/back.png) no-repeat;
}

.icon-submit{
	background:url(icons/select.png) no-repeat;
}

.icon-users{
	background:url(icons/users.png) no-repeat;
}

.icon-word{
	background:url(icons/word.png) no-repeat;
}

.icon-ppt{
	background:url(icons/ppt.png) no-repeat;
}

.icon-excel{
	background:url(icons/excel.png) no-repeat;
}

.icon-html{
	background:url(icons/html.png) no-repeat;
}

.view-img{
	cursor: pointer;
}

.icon-copyup{
	background:url(icons/copyup.png) no-repeat;
}

.icon-copydown{
	background:url(icons/copydown.png) no-repeat;
}

.icon-agree{
	background:url(icons/icon-agree.png) no-repeat;
}

.icon-refuse{
	background:url(icons/icon-refuse.png) no-repeat;
}

.icon-back{
	background:url(icons/icon-back.png) no-repeat;
}

.icon-startor{
	background:url(icons/icon-startor.png) no-repeat;
}
.icon-attention{
	background:url(icons/icon-attention.png) no-repeat;
}
.icon-careAbout{
	background:url(icons/icon-careAbout.png) no-repeat;
}

.icon-abstain{
	background:url(icons/icon-abstain.png) no-repeat;
}

.icon-newmail{
	background:url(icons/icon-newmail.png) no-repeat;
}

.icon-readmail{
	background:url(icons/icon-readmail.png) no-repeat;
}

.icon-mail{
	background:url(icons/mail.png) no-repeat;
}

.icon-reply{
	background:url(icons/icon-reply.png) no-repeat;
}

.icon-getmail{
	background:url(icons/icon-getmail.png) no-repeat;
}

.icon-weixin{
	background:url(icons/weixin.png) no-repeat;
}

.icon-writemail{
	background:url(icons/icon-writemail.png) no-repeat;
}

.icon-transmit{
	background:url(icons/icon-transmit.png) no-repeat;
}

.icon-trash{
	background:url(icons/icon-trash.gif) no-repeat;
}

.icon-sender{
	background:url(icons/icon-sender.png) no-repeat;
}

.icon-receive{
	background:url(icons/icon-receive.png) no-repeat;
}

.icon-draft{
	background:url(icons/icon-draft.png) no-repeat;
}

.icon-send{
	background:url(icons/icon-send.png) no-repeat;
}

.icon-mailconnect{
	background:url(icons/icon-mailconnect.png) no-repeat;
}

.icon-normal{
	background:url(icons/icon-normal.png) no-repeat;
}

.icon-important{
	background:url(icons/icon-important.png) no-repeat;
}

.icon-vital{
	background:url(icons/icon-vital.png) no-repeat;
}

.icon-textbox{
	background:url(icons/icon-textbox.png) no-repeat;
}

.icon-textarea{
	background:url(icons/icon-textarea.png) no-repeat;
}

.icon-checkboxlist{
	background:url(icons/icon-checkboxlist.png) no-repeat;
}

.icon-radiobuttonlist{
	background:url(icons/icon-radiobutton.png) no-repeat;
}

.icon-checkbox{
	background:url(icons/icon-checkbox.png) no-repeat;
}

.icon-combobox{
	background:url(icons/icon-combobox.png) no-repeat;
}

.icon-datepicker{
	background:url(icons/icon-date.png) no-repeat;
}

.icon-monthpicker{
	background:url(icons/icon-month.png) no-repeat;
}

.icon-timespinner{
	background:url(icons/icon-timeinput.png) no-repeat;
}

.icon-spinner{
	background:url(icons/icon-numberinput.png) no-repeat;
}

.icon-ueditor{
	background:url(icons/icon-editor.png) no-repeat;
}

.icon-user{
	background:url(icons/icon-users.png) no-repeat;
}

.icon-upload{
	background:url(icons/icon-upload.png) no-repeat;
}

.icon-hidden{
	background:url(icons/icon-hidden.png) no-repeat;
}

.icon-buttonedit{
	background:url(icons/icon-buttoninput.png) no-repeat;
}

.icon-dep{
	background:url(icons/icon-dept.png) no-repeat;
}

.icon-table{
	background:url(icons/icon-table.png) no-repeat;
}

.rx-grid{
	background:url(icons/icon-table.png) no-repeat;
}

.icon-treeselect{
	background:url(icons/icon-treeselect.png) no-repeat;
}

.icon-property{
	background:url(icons/property.png) no-repeat;
}

.icon-libary{
	background:url(icons/icon-libary.png) no-repeat;
}

.icon-method{
	background:url(icons/icon-method.png) no-repeat;
}

.icon-msg{
	background:url(icons/messages.png) no-repeat;
}

.icon-bpm-draft{
	background:url(icons/icon-bpm-draft.png) no-repeat;
}

.icon-running{
	background:url(icons/icon-running.png) no-repeat;
}

.icon-success-end{
	background:url(icons/icon-success-end.png) no-repeat;
}

span.icon-button{
	display:block;
	width:20px;
	height:16px;
	padding-left:2px;
	paddng-right:2px;
	cursor: pointer;
	float:left;
}
/*上传的图片标*/
.upload-file{
	cursor:pointer;
}


text:
Ignited CMS Pro

            <section class="tab-content"

redpajama_set_name: RedPajamaGithub


text:
package cz.metacentrum.perun.core.api;

import java.util.List;

import cz.metacentrum.perun.core.api.exceptions.AlreadyAdminException;
import cz.metacentrum.perun.core.api.exceptions.FacilityAlreadyRemovedException;
import cz.metacentrum.perun.core.api.exceptions.FacilityContactNotExistsException;
import cz.metacentrum.perun.core.api.exceptions.FacilityExistsException;
import cz.metacentrum.perun.core.api.exceptions.FacilityNotExistsException;
import cz.metacentrum.perun.core.api.exceptions.GroupAlreadyRemovedException;
import cz.metacentrum.perun.core.api.exceptions.GroupAlreadyRemovedFromResourceException;
import cz.metacentrum.perun.core.api.exceptions.GroupNotAdminException;
import cz.metacentrum.perun.core.api.exceptions.GroupNotExistsException;
import cz.metacentrum.perun.core.api.exceptions.HostAlreadyRemovedException;
import cz.metacentrum.perun.core.api.exceptions.HostNotExistsException;
import cz.metacentrum.perun.core.api.exceptions.InternalErrorException;
import cz.metacentrum.perun.core.api.exceptions.MemberNotExistsException;
import cz.metacentrum.perun.core.api.exceptions.OwnerAlreadyAssignedException;
import cz.metacentrum.perun.core.api.exceptions.OwnerAlreadyRemovedException;
import cz.metacentrum.perun.core.api.exceptions.OwnerNotExistsException;
import cz.metacentrum.perun.core.api.exceptions.PrivilegeException;
import cz.metacentrum.perun.core.api.exceptions.RelationExistsException;
import cz.metacentrum.perun.core.api.exceptions.SecurityTeamAlreadyAssignedException;
import cz.metacentrum.perun.core.api.exceptions.SecurityTeamNotAssignedException;
import cz.metacentrum.perun.core.api.exceptions.SecurityTeamNotExistsException;
import cz.metacentrum.perun.core.api.exceptions.ServiceNotExistsException;
import cz.metacentrum.perun.core.api.exceptions.UserNotExistsException;
import cz.metacentrum.perun.core.api.exceptions.HostExistsException;
import cz.metacentrum.perun.core.api.exceptions.ResourceAlreadyRemovedException;
import cz.metacentrum.perun.core.api.exceptions.UserNotAdminException;
import cz.metacentrum.perun.core.api.exceptions.VoNotExistsException;
import cz.metacentrum.perun.core.api.exceptions.WrongAttributeAssignmentException;
import cz.metacentrum.perun.core.api.exceptions.WrongAttributeValueException;
import cz.metacentrum.perun.core.api.exceptions.WrongPatternException;
import cz.metacentrum.perun.core.api.exceptions.WrongReferenceAttributeValueException;

/**
 * Facility manager can create a new facility or find an existing facility.
 *
 * @author Michal Prochazka
 * @author Slavek Licehammer
 */
public interface FacilitiesManager {

	public final static String CLUSTERTYPE = "cluster";
	public final static String VIRTUALCLUSTERTYPE = "vcluster";
	public final static String HOSTTYPE = "host";
	public final static String VIRTUALHOSTTYPE = "vhost";
	public final static String GENERALTYPE = "general";
	public final static String STORAGE = "storage";

	/**
	 * Searches for the Facility with specified id.
	 *
	 * @param perunSession
	 * @param id
	 *
	 * @return Facility with specified id
	 *
	 * @throws FacilityNotExistsException
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 */
	Facility getFacilityById(PerunSession perunSession, int id) throws InternalErrorException, FacilityNotExistsException, PrivilegeException;

	/**
	 * Searches the Facility by its name.
	 *
	 * @param perunSession
	 * @param name
	 *
	 * @return Facility with specified name
	 *
	 * @throws FacilityNotExistsException
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 */
	Facility getFacilityByName(PerunSession perunSession, String name) throws InternalErrorException, FacilityNotExistsException, PrivilegeException;

	/**
	 * Get all possible rich Facilities with all their owners.
	 * For PerunAdmin get All richFacilities.
	 * For FacilityAdmin get only richFacilities under his administration.
	 *
	 * @param perunSession
	 * @return list of RichFacilities with owners
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 */
	List<RichFacility> getRichFacilities(PerunSession perunSession) throws InternalErrorException, PrivilegeException;

	/**
	 * Searches for the Facilities by theirs destination.
	 *
	 * @param perunSession
	 * @param destination
	 *
	 * @return Facilities with specified name
	 *
	 * @throws FacilityNotExistsException  //FIXME proc tato vyjimka?
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 */
	List<Facility> getFacilitiesByDestination(PerunSession perunSession, String destination) throws InternalErrorException, FacilityNotExistsException, PrivilegeException;

	/**
	 * Get count of all facilities.
	 *
	 * @param perunSession
	 *
	 * @return count of all facilities
	 *
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 */
	int getFacilitiesCount(PerunSession perunSession) throws InternalErrorException, PrivilegeException;

	/**
	 * List facilities by ACCESS RIGHTS:
	 * If User is:
	 * - PERUNADMIN : all facilities
	 * - FACILITYADMIN : only facilities where user is facility admin
	 *
	 * @param perunSession
	 *
	 * @return List of all Facilities within the Perun
	 *
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 */
	List<Facility> getFacilities(PerunSession perunSession) throws InternalErrorException, PrivilegeException;

	/**
	 * Returns owners of the facility.
	 *
	 * @param perunSession
	 * @param facility
	 *
	 * @return owners of specified facility
	 *
	 * @throws FacilityNotExistsException
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 */
	List<Owner> getOwners(PerunSession perunSession, Facility facility) throws InternalErrorException, PrivilegeException, FacilityNotExistsException;

	/**
	 * Updates owners of facility
	 *
	 * @param perunSession
	 * @param facility
	 * @param owners
	 *
	 * @throws FacilityNotExistsException
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 * @throws OwnerNotExistsException
	 *
	 * @deprecated Use addOwner and removeOwner instead
	 */
	@Deprecated
	void setOwners(PerunSession perunSession, Facility facility, List<Owner> owners) throws InternalErrorException, PrivilegeException, FacilityNotExistsException, OwnerNotExistsException;

	/**
	 * Add owner of the facility
	 *
	 * @param perunSession
	 * @param facility
	 * @param owner
	 *
	 * @throws FacilityNotExistsException
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 * @throws OwnerNotExistsException
	 * @throws OwnerAlreadyAssignedException
	 */
	void addOwner(PerunSession perunSession, Facility facility, Owner owner) throws InternalErrorException, PrivilegeException, OwnerNotExistsException, FacilityNotExistsException, OwnerAlreadyAssignedException;

	/**
	 * Remove owner of the facility
	 *
	 * @param perunSession
	 * @param facility
	 * @param owner
	 *
	 * @throws FacilityNotExistsException
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 * @throws OwnerNotExistsException
	 * @throws OwnerAlreadyRemovedException
	 */
	void removeOwner(PerunSession perunSession, Facility facility, Owner owner) throws InternalErrorException, PrivilegeException, OwnerNotExistsException, FacilityNotExistsException, OwnerAlreadyRemovedException;

	/**
	 * Copy all owners of the source facility to the destination facility.
	 * The owners, that are in the destination facility and aren't in the source facility, are retained.
	 * The common owners are replaced with owners from source facility.
	 *
	 * @param sourceFacility
	 * @param destinationFacility
	 * @throws InternalErrorException
	 * @throws FacilityNotExistsException
	 * @throws PrivilegeException
	 */
	public void copyOwners(PerunSession sess, Facility sourceFacility, Facility destinationFacility) throws InternalErrorException, FacilityNotExistsException, PrivilegeException;

	/**
	 * Return all VO which can use this facility. (VO muset have the resource which belongs to this facility)
	 *
	 * @param perunSession
	 * @param facility
	 *
	 * @return list of Vos
	 *
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 * @throws FacilityNotExistsException
	 */
	List<Vo> getAllowedVos(PerunSession perunSession, Facility facility) throws InternalErrorException, PrivilegeException, FacilityNotExistsException;

	/**
	 * Get all Groups which can use this facility (Groups must be assigned to resource which belongs to this facility)
	 * specificVo and specificService can choose concrete groups
	 * if specificVo, specificService or both are null, they do not specific (all possible results are returned)
	 *
	 * @param perunSession
	 * @param facility searching for this facility
	 * @param specificVo specific only those results which are in specific VO (with null, all results)
	 * @param specificService specific only those results, which have resource with assigned specific service (if null, all results)
	 * @return list of allowed groups
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 * @throws FacilityNotExistsException if facility not exist, return this exception
	 * @throws ServiceNotExistsException if service is not null and not exist
	 * @throws VoNotExistsException if vo is not null and not exist
	 */
	List<Group> getAllowedGroups(PerunSession perunSession, Facility facility, Vo specificVo, Service specificService) throws InternalErrorException, PrivilegeException, FacilityNotExistsException, ServiceNotExistsException, VoNotExistsException;

	/**
	 * Return all users who can use this facility
	 *
	 * @param perunSession
	 * @param facility
	 *
	 * @return list of users
	 *
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 * @throws FacilityNotExistsException
	 */
	List<User> getAllowedUsers(PerunSession perunSession, Facility facility) throws InternalErrorException, PrivilegeException, FacilityNotExistsException;

	/**
	 * Return all users who can use this facility
	 * specificVo and specificService can choose concrete users
	 * if specificVo, specificService or both are null, they do not specific (all possible results are returned)
	 *
	 * @param perunSession
	 * @param facility
	 * @param specificVo specific only those results which are in specific VO (with null, all results)
	 * @param specificService specific only those results, which have resource with assigned specific service (if null, all results)
	 *
	 * @return list of users
	 *
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 * @throws FacilityNotExistsException
	 * @throws ServiceNotExistsException if service is not null and not exist
	 * @throws VoNotExistsException if vo is not null and not exist
	 */
	List<User> getAllowedUsers(PerunSession perunSession, Facility facility, Vo specificVo, Service specificService) throws InternalErrorException, PrivilegeException, FacilityNotExistsException, ServiceNotExistsException, VoNotExistsException;

	/**
	 * Returns all resources assigned to the facility.
	 *
	 * @param perunSession
	 * @param facility
	 *
	 * @return list of resources assigned to the facility
	 *
	 * @throws FacilityNotExistsException
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 */
	List<Resource> getAssignedResources(PerunSession perunSession, Facility facility) throws InternalErrorException, PrivilegeException, FacilityNotExistsException;

	/**
	 * Returns all rich resources assigned to the facility with VO property filled
	 *
	 * @param perunSession
	 * @param facility
	 *
	 * @return list of rich resources assigned to the facility
	 *
	 * @throws FacilityNotExistsException
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 */
	List<RichResource> getAssignedRichResources(PerunSession perunSession, Facility facility) throws InternalErrorException, PrivilegeException, FacilityNotExistsException;

	/**
	 * Store the facility.
	 *
	 * @param perunSession
	 * @param facility
	 * @return
	 * @throws InternalErrorException
	 * @throws FacilityExistsException
	 * @throws PrivilegeException
	 */
	Facility createFacility(PerunSession perunSession, Facility facility) throws InternalErrorException, PrivilegeException, FacilityExistsException;

	/**
	 * Delete the facility by id.
	 *
	 * @param perunSession
	 * @param facility
	 *
	 * @throws InternalErrorException
	 * @throws FacilityNotExistsException
	 * @throws PrivilegeException
	 * @throws RelationExistsException
	 * @throws FacilityAlreadyRemovedException if 0 rows affected by delete from DB
	 * @throws HostAlreadyRemovedException if there is at least 1 hosts not affected by deleting from DB
	 * @throws GroupAlreadyRemovedException if there is at least 1 group not affected by deleting from DB
	 * @throws ResourceAlreadyRemovedException if there is at least 1 resource not affected by deleting from DB
	 * @throws GroupAlreadyRemovedFromResourceException if there is at least 1 group on any resource affected by removing from DB
	 */
	void deleteFacility(PerunSession perunSession, Facility facility) throws InternalErrorException, RelationExistsException, FacilityNotExistsException, PrivilegeException, FacilityAlreadyRemovedException, HostAlreadyRemovedException, GroupAlreadyRemovedException, ResourceAlreadyRemovedException, GroupAlreadyRemovedFromResourceException;

	/**
	 * Updates facility.
	 *
	 * @param perunSession
	 * @param facility to update
	 *
	 * @return updated facility
	 *
	 * @throws InternalErrorException
	 * @throws FacilityNotExistsException
	 * @throws PrivilegeException
	 */
	Facility updateFacility(PerunSession perunSession, Facility facility) throws FacilityNotExistsException, InternalErrorException, PrivilegeException;

	/**
	 * Returns list of all facilities owned by the owner.
	 *
	 * @param perunSession
	 * @param owner
	 *
	 * @return list of facilities owned by the owner
	 *
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 * @throws OwnerNotExistsException
	 */
	List<Facility> getOwnerFacilities(PerunSession perunSession, Owner owner) throws InternalErrorException, OwnerNotExistsException, PrivilegeException;

	/**
	 * Get facilities which are assigned to Group (via resource).
	 *
	 * @param sess
	 * @param group
	 * @return
	 *
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 * @throws GroupNotExistsException
	 */
	List<Facility> getAssignedFacilities(PerunSession sess, Group group) throws InternalErrorException, PrivilegeException, GroupNotExistsException;

	/**
	 * Get facilities which have the member access on.
	 *
	 * @param sess
	 * @param member
	 * @return
	 *
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 * @throws MemberNotExistsException
	 */
	List<Facility> getAssignedFacilities(PerunSession sess, Member member) throws InternalErrorException, PrivilegeException, MemberNotExistsException;

	/**
	 * Get facilities which have the user access on.
	 *
	 * @param sess
	 * @param user
	 * @return
	 *
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 * @throws UserNotExistsException
	 */
	List<Facility> getAssignedFacilities(PerunSession sess, User user) throws InternalErrorException, PrivilegeException, UserNotExistsException;

	/**
	 * Get facilities where the service is defined.
	 *
	 * @param sess
	 * @param service
	 * @return
	 *
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 * @throws ServiceNotExistsException
	 */
	List<Facility> getAssignedFacilities(PerunSession sess, Service service) throws InternalErrorException, PrivilegeException, ServiceNotExistsException;

	/**
	 * Get facilities where security team is assigned.
	 *
	 * @param sess
	 * @param securityTeam
	 * @return
	 *
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 * @throws SecurityTeamNotExistsException
	 */
	List<Facility> getAssignedFacilities(PerunSession sess, SecurityTeam securityTeam) throws InternalErrorException, PrivilegeException, SecurityTeamNotExistsException;

	/**
	 * List hosts of Facility.
	 *
	 * @param sess
	 * @param facility
	 *
	 * @return hosts
	 *
	 * @throws FacilityNotExistsException
	 * @throws PrivilegeException
	 * @throws InternalErrorException
	 *
	 */
	List<Host> getHosts(PerunSession sess, Facility facility) throws FacilityNotExistsException, InternalErrorException, PrivilegeException;

	/**
	 * Count hosts of Facility.
	 *
	 * @param sess
	 * @param facility
	 *
	 * @return the number of hosts present in the facility
	 *
	 * @throws FacilityNotExistsException
	 * @throws PrivilegeException
	 * @throws InternalErrorException
	 */
	int getHostsCount(PerunSession sess, Facility facility) throws FacilityNotExistsException, InternalErrorException, PrivilegeException;

	/**
	 * Adds hosts to the Facility.
	 * Adds hosts only if host and destination with the same name doesn't exist or if privilege requirements are met.
	 * Note: If you wish to add more hosts, it is recommended to
	 * prepare a List<Host> of them so as there can be only one
	 * database call.
	 *
	 * @param sess
	 * @param hosts ID of any host doesn't need to be filled. Hosts will be created.
	 * @param facility
	 *
	 * @return Hosts with ID's set.
	 *
	 * @throws FacilityNotExistsException
	 * @throws PrivilegeException
	 * @throws InternalErrorException
	 * @throws HostExistsException
	 */
	List<Host> addHosts(PerunSession sess, List<Host> hosts, Facility facility) throws FacilityNotExistsException, InternalErrorException, PrivilegeException, HostExistsException;

	/**
	 * Create hosts in Perun and add them to the Facility.
	 * Adds hosts only if host and destination with the same name doesn't exist or if privilege requirements are met.
	 * Names of the hosts can be generative.
	 * The pattern is string with square brackets, e.g. "local[1-3]domain". Then the content of the brackets
	 * is distributed, so the list is [local1domain, local2domain, local3domain].
	 * Multibrackets are aslo allowed. For example "a[00-01]b[90-91]c" generates [a00b90c, a00b91c, a01b90c, a01b91c].
	 *
	 * @param sess
	 * @param hosts list of strings with names of hosts, the name can by generative
	 * @param facility
	 *
	 * @return Hosts with ID's set.
	 *
	 * @throws FacilityNotExistsException
	 * @throws PrivilegeException
	 * @throws InternalErrorException
	 * @throws HostExistsException
	 * @throws WrongPatternException when syntax of any of the hostnames is wrong
	 */
	List<Host> addHosts(PerunSession sess, Facility facility, List<String> hosts) throws FacilityNotExistsException, InternalErrorException, PrivilegeException, HostExistsException, WrongPatternException;

	/**
	 * Remove hosts from the Facility.
	 *
	 * @param sess
	 * @param hosts
	 * @param facility
	 *
	 * @throws FacilityNotExistsException
	 * @throws PrivilegeException
	 * @throws InternalErrorException
	 * @throws HostAlreadyRemovedException if there is at least 1 host not affected by deleting from DB
	 */
	void removeHosts(PerunSession sess, List<Host> hosts, Facility facility) throws FacilityNotExistsException, InternalErrorException, PrivilegeException, HostAlreadyRemovedException;

	/**
	 * Adds host to the Facility.
	 * Adds host only if host and destination with the same name doesn't exist or if privilege requirements are met.
	 *
	 * @param perunSession
	 * @param host
	 * @param facility
	 *
	 * return host
	 *
	 * @throws InternalErrorException
	 * @throws FacilityNotExistsException
	 * @throws PrivilegeException
	 */
	Host addHost(PerunSession perunSession, Host host, Facility facility) throws InternalErrorException, FacilityNotExistsException, PrivilegeException;

	/**
	 * Remove hosts from the Facility.
	 *
	 * @param perunSession
	 * @param host
	 *
	 * @throws InternalErrorException
	 * @throws HostNotExistsException
	 * @throws PrivilegeException
	 * @throws HostAlreadyRemovedException if there are 0 rows affected by deleting from DB
	 */
	void removeHost(PerunSession perunSession, Host host) throws InternalErrorException, HostNotExistsException, PrivilegeException, HostAlreadyRemovedException;

	/**
	 * Get the host by its ID.
	 *
	 * @param sess
	 * @param id
	 * @return host
	 * @throws HostNotExistsException
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 */
	Host getHostById(PerunSession sess, int id) throws HostNotExistsException, InternalErrorException, PrivilegeException;

	/**
	 * Get all hosts with this hostname (from all facilities).
	 *
	 * Facility Admin get only those which are from his facilities.
	 *
	 * @param sess
	 * @param hostname
	 * @return list of hosts by hostname
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 */
	List<Host> getHostsByHostname(PerunSession sess, String hostname) throws InternalErrorException, PrivilegeException;

	/**
	 * Return facility which has the host.
	 *
	 * @param sess
	 * @param host
	 * @return facility
	 * @throws HostNotExistsException
	 * @throws InternalErrorException
	 */
	Facility getFacilityForHost(PerunSession sess, Host host) throws InternalErrorException, PrivilegeException, HostNotExistsException;

	/**
	 * Return all facilities where exists host with the specific hostname
	 *
	 * @param sess
	 * @param hostname specific hostname
	 * @return
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 */
	List<Facility> getFacilitiesByHostName(PerunSession sess, String hostname) throws InternalErrorException, PrivilegeException;

	/**
	 * Adds user administrator to the Facility.
	 *
	 * @param sess
	 * @param facility
	 * @param user
	 * @throws InternalErrorException
	 * @throws FacilityNotExistsException
	 * @throws UserNotExistsException
	 * @throws PrivilegeException
	 * @throws AlreadyAdminException
	 */
	void addAdmin(PerunSession sess, Facility facility, User user) throws InternalErrorException, FacilityNotExistsException, UserNotExistsException, PrivilegeException, AlreadyAdminException;

	/**
	 * Adds group administrator to the Facility.
	 *
	 * @param sess
	 * @param facility
	 * @param group that will become a Facility administrator
	 * @throws InternalErrorException
	 * @throws FacilityNotExistsException
	 * @throws GroupNotExistsException
	 * @throws PrivilegeException
	 * @throws AlreadyAdminException
	 */
	void addAdmin(PerunSession sess, Facility facility, Group group) throws InternalErrorException, FacilityNotExistsException, GroupNotExistsException, PrivilegeException, AlreadyAdminException;

	/**
	 * Removes a user administrator from the Facility.
	 *
	 * @param sess
	 * @param facility
	 * @param user
	 * @throws InternalErrorException
	 * @throws FacilityNotExistsException
	 * @throws UserNotExistsException
	 * @throws PrivilegeException
	 * @throws UserNotAdminException
	 */
	void removeAdmin(PerunSession sess, Facility facility, User user) throws InternalErrorException, FacilityNotExistsException, UserNotExistsException, PrivilegeException, UserNotAdminException;

	/**
	 * Removes a group administrator from the Facility.
	 *
	 * @param sess
	 * @param facility
	 * @param group group that will lose a Facility administrator role
	 * @throws InternalErrorException
	 * @throws FacilityNotExistsException
	 * @throws GroupNotExistsException
	 * @throws PrivilegeException
	 * @throws GroupNotAdminException
	 */
	void removeAdmin(PerunSession sess, Facility facility, Group group) throws InternalErrorException, FacilityNotExistsException, GroupNotExistsException, PrivilegeException, GroupNotAdminException;

	/**
	 * Get list of all user administrators for supported role and given facility.
	 *
	 * If onlyDirectAdmins is true, return only direct users of the group for supported role.
	 *
	 * Supported roles: FacilityAdmin
	 *
	 * @param perunSession
	 * @param facility
	 * @param onlyDirectAdmins if true, get only direct user administrators (if false, get both direct and indirect)
	 *
	 * @return list of all user administrators of the given facility for supported role
	 *
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 * @throws FacilityNotExistsException
	 */
	List<User> getAdmins(PerunSession perunSession, Facility facility, boolean onlyDirectAdmins) throws InternalErrorException, PrivilegeException, FacilityNotExistsException;

	/**
	 * Get list of all richUser administrators for the facility and supported role with specific attributes.
	 *
	 * Supported roles: FacilityAdmin
	 *
	 * If "onlyDirectAdmins" is "true", return only direct users of the group for supported role with specific attributes.
	 * If "allUserAttributes" is "true", do not specify attributes through list and return them all in objects richUser. Ignoring list of specific attributes.
	 *
	 * @param perunSession
	 * @param group
	 *
	 * @param specificAttributes list of specified attributes which are needed in object richUser
	 * @param allUserAttributes if true, get all possible user attributes and ignore list of specificAttributes (if false, get only specific attributes)
	 * @param onlyDirectAdmins if true, get only direct user administrators (if false, get both direct and indirect)
	 *
	 * @return list of RichUser administrators for the facility and supported role with attributes
	 *
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 * @throws UserNotExistsException
	 * @throws FacilityNotExistsException
	 */
	List<RichUser> getRichAdmins(PerunSession perunSession, Facility facility, List<String> specificAttributes, boolean allUserAttributes, boolean onlyDirectAdmins) throws InternalErrorException, UserNotExistsException, PrivilegeException, FacilityNotExistsException;

	/**
	 * Gets list of all user administrators of the Facility.
	 * If some group is administrator of the given group, all members are included in the list.
	 *
	 * @param sess
	 * @param facility
	 * @return list of Users who are admins in the facility.
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 */
	@Deprecated
	List<User> getAdmins(PerunSession sess, Facility facility) throws InternalErrorException, PrivilegeException, FacilityNotExistsException;

	/**
	 * Gets list of direct user administrators of the Facility.
	 * 'Direct' means, there aren't included users, who are members of group administrators, in the returned list.
	 *
	 * @param perunSession
	 * @param facility
	 *
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 * @throws FacilityNotExistsException
	 */
	@Deprecated
	List<User> getDirectAdmins(PerunSession perunSession, Facility facility) throws InternalErrorException, PrivilegeException, FacilityNotExistsException;

	/**
	 * Gets list of all group administrators of the Facility.
	 *
	 * @param sess
	 * @param facility
	 * @return list of Group that are admins in the facility.
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 */
	List<Group> getAdminGroups(PerunSession sess, Facility facility) throws InternalErrorException, PrivilegeException, FacilityNotExistsException;

	/**
	 * Get all Facility admins without attributes.
	 *
	 * @param sess
	 * @param facility
	 * @return return list of RichUsers without attributes.
	 * @throws InternalErrorException
	 * @throws UserNotExistsException
	 * @throws PrivilegeException
	 */
	@Deprecated
	List<RichUser> getRichAdmins(PerunSession sess, Facility facility) throws InternalErrorException, UserNotExistsException, FacilityNotExistsException, PrivilegeException;

	/**
	 * Get all Facility admins with attributes.
	 *
	 * @param sess
	 * @param facility
	 * @return list of RichUsers who are admins in the facility WITH ATTRIBUTES.
	 * @throws InternalErrorException
	 * @throws UserNotExistsException
	 * @throws PrivilegeException
	 * @throws FacilityNotExistsException
	 */
	@Deprecated
	List<RichUser> getRichAdminsWithAttributes(PerunSession sess, Facility facility) throws InternalErrorException, UserNotExistsException, PrivilegeException, FacilityNotExistsException;

	/**
	 * Get list of Facility administrators with specific attributes.
	 * From list of specificAttributes get all Users Attributes and find those for every RichAdmin (only, other attributes are not searched)
	 *
	 * @param perunSession
	 * @param facility
	 * @param specificAttributes
	 * @return list of RichUsers with specific attributes.
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 * @throws VoNotExistsException
	 */
	@Deprecated
	List<RichUser> getRichAdminsWithSpecificAttributes(PerunSession perunSession, Facility facility, List<String> specificAttributes) throws InternalErrorException, PrivilegeException, FacilityNotExistsException;

	/**
	 * Get list of Facility administrators, which are assigned directly (not by group membership), with specific attributes.
	 * From list of specificAttributes get all Users Attributes and find those for every RichAdmin (only, other attributes are not searched)
	 *
	 * @param perunSession
	 * @param facility
	 * @param specificAttributes
	 * @return list of RichUsers with specific attributes.
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 * @throws VoNotExistsException
	 */
	@Deprecated
	List<RichUser> getDirectRichAdminsWithSpecificAttributes(PerunSession perunSession, Facility facility, List<String> specificAttributes) throws InternalErrorException, PrivilegeException, FacilityNotExistsException;

	/**
	 * Returns list of Facilities, where the user is an admin.
	 *
	 * @param sess
	 * @param user
	 * @return list of Facilities, where the user is an admin.
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 * @throws UserNotExistsException
	 */
	List<Facility> getFacilitiesWhereUserIsAdmin(PerunSession sess, User user) throws InternalErrorException, UserNotExistsException, PrivilegeException;

	/**
	 * Returns list of Users, assigned with chosen Facility.
	 *
	 * @param sess
	 * @param facility
	 *
	 * @return list of users
	 *
	 * @throws PrivilegeException
	 * @throws InternalErrorException
	 */
	List<User> getAssignedUsers(PerunSession sess, Facility facility) throws PrivilegeException, InternalErrorException;

	/**
	 * Returns list of Users assigned with chosen Facility containing resources where service is assigned.
	 *
	 * @param sess
	 * @param facility
	 * @param service
	 *
	 * @return list of users
	 *
	 * @throws PrivilegeException
	 * @throws InternalErrorException
	 */

	List<User> getAssignedUsers(PerunSession sess, Facility facility, Service service) throws PrivilegeException, InternalErrorException;

	/**
	 * Copy all managers(admins) of the source facility to the destination facility.
	 * The admins, that are in the destination facility and aren't in the source facility, are retained.
	 * The common admins are replaced with admins from source facility.
	 *
	 * @param sess
	 * @param sourceFacility
	 * @param destinationFacility
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 * @throws FacilityNotExistsException
	 */
	void copyManagers(PerunSession sess, Facility sourceFacility, Facility destinationFacility) throws InternalErrorException, PrivilegeException, FacilityNotExistsException;

	/**
	 * Copy all attributes of the source facility to the destination facility.
	 * The attributes, that are in the destination facility and aren't in the source facility, are retained.
	 * The common attributes are replaced with attributes from source facility.
	 *
	 * @param sess
	 * @param sourceFacility
	 * @param destinationFacility
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 * @throws FacilityNotExistsException
	 * @throws WrongAttributeAssignmentException if there is no facility attribute
	 * @throws WrongAttributeValueException if the attribute value is illegal
	 * @throws WrongReferenceAttributeValueException if the attribute value is illegal
	 */
	public void copyAttributes(PerunSession sess, Facility sourceFacility, Facility destinationFacility) throws InternalErrorException, PrivilegeException, FacilityNotExistsException, WrongAttributeAssignmentException, WrongAttributeValueException, WrongReferenceAttributeValueException;

	// FACILITY CONTACTS METHODS

	/**
	 * Get list of contact groups for the owner.
	 *
	 * @param sess
	 * @param owner
	 * @return list of ContactGroups for the owner
	 * @throws InternalErrorException
	 */
	List<ContactGroup> getFacilityContactGroups(PerunSession sess, Owner owner) throws InternalErrorException, PrivilegeException, OwnerNotExistsException;

	/**
	 * Get list of contact groups for the user.
	 *
	 * @param sess
	 * @param user
	 * @return list of ContactGroups for the user
	 * @throws InternalErrorException
	 */
	List<ContactGroup> getFacilityContactGroups(PerunSession sess, User user) throws InternalErrorException, PrivilegeException, UserNotExistsException;

	/**
	 * Get list of contact groups for the group.
	 *
	 * @param sess
	 * @param group
	 * @return list of ContactGroups for the group
	 * @throws InternalErrorException
	 */
	List<ContactGroup> getFacilityContactGroups(PerunSession sess, Group group) throws InternalErrorException, PrivilegeException, GroupNotExistsException;

	/**
	 * Get list of contact groups for the facility
	 *
	 * @param sess
	 * @param facility
	 * @return list of ContactGroups for the facility
	 * @throws InternalErrorException
	 * @throws FacilityContactNotExistsException
	 */
	List<ContactGroup> getFacilityContactGroups(PerunSession sess, Facility facility) throws InternalErrorException, FacilityContactNotExistsException, PrivilegeException, FacilityNotExistsException;

	/**
	 * Get contact group for the facility and the contact group name
	 *
	 * @param sess
	 * @param facility
	 * @param name
	 * @return contactGroup for the facility and the contact group name
	 * @throws InternalErrorException
	 * @throws FacilityContactNotExistsException
	 */
	ContactGroup getFacilityContactGroup(PerunSession sess, Facility facility, String name) throws InternalErrorException, FacilityContactNotExistsException, PrivilegeException, FacilityNotExistsException;

	/**
	 * Get all exist contact group names.
	 *
	 * @param sess
	 * @return list of all contact group names
	 * @throws InternalErrorException
	 */
	List<String> getAllContactGroupNames(PerunSession sess) throws InternalErrorException, PrivilegeException, FacilityNotExistsException;

	/**
	 * Create all contacts from list of contact groups
	 *
	 * @param sess
	 * @param contactGroupsToAdd
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 * @throws FacilityNotExistsException
	 * @throws OwnerNotExistsException
	 * @throws UserNotExistsException
	 * @throws GroupNotExistsException
	 */
	void addFacilityContacts(PerunSession sess, List<ContactGroup> contactGroupsToAdd) throws InternalErrorException, PrivilegeException, FacilityNotExistsException, OwnerNotExistsException, UserNotExistsException, GroupNotExistsException;

	/**
	 * Create all contacts from contact group
	 *
	 * @param sess
	 * @param contactGroupToAdd
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 * @throws FacilityNotExistsException
	 * @throws OwnerNotExistsException
	 * @throws UserNotExistsException
	 * @throws GroupNotExistsException
	 */
	void addFacilityContact(PerunSession sess, ContactGroup contactGroupToAdd) throws InternalErrorException, PrivilegeException, FacilityNotExistsException, OwnerNotExistsException, UserNotExistsException, GroupNotExistsException;

	/**
	 * Remove all contacts from list of contact groups
	 *
	 * @param sess
	 * @param contactGroupsToRemove
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 * @throws FacilityNotExistsException
	 * @throws OwnerNotExistsException
	 * @throws UserNotExistsException
	 * @throws GroupNotExistsException
	 */
	void removeFacilityContacts(PerunSession sess, List<ContactGroup> contactGroupsToRemove) throws InternalErrorException, PrivilegeException, FacilityNotExistsException, OwnerNotExistsException, UserNotExistsException, GroupNotExistsException;

	/**
	 * Remove all contacts from contact group
	 *
	 * @param sess
	 * @param contactGroupToRemove
	 * @throws InternalErrorException
	 * @throws PrivilegeException
	 * @throws FacilityNotExistsException
	 * @throws OwnerNotExistsException
	 * @throws UserNotExistsException
	 * @throws GroupNotExistsException
	 */
	void removeFacilityContact(PerunSession sess, ContactGroup contactGroupToRemove) throws InternalErrorException, PrivilegeException, FacilityNotExistsException, OwnerNotExistsException, UserNotExistsException, GroupNotExistsException;

	/**
	 * return assigned security teams for specific facility
	 *
	 * @param sess
	 * @param facility
	 * @return assigned security teams fot given facility
	 * @throws InternalErrorException
	 * @throws PrivilegeException can do only PerunAdmin or FacilityAdmin of the facility
	 * @throws FacilityNotExistsException
	 */
	List<SecurityTeam> getAssignedSecurityTeams(PerunSession sess, Facility facility) throws InternalErrorException, PrivilegeException, FacilityNotExistsException;

	/**
	 * Assign given security team to given facility (means the facility trusts the security team)
	 *
	 * @param sess
	 * @param facility
	 * @param securityTeam
	 * @throws InternalErrorException
	 * @throws PrivilegeException can do only PerunAdmin or FacilityAdmin of the facility
	 * @throws FacilityNotExistsException
	 * @throws SecurityTeamNotExistsException
	 * @throws SecurityTeamAlreadyAssignedException
	 */
	void assignSecurityTeam(PerunSession sess, Facility facility, SecurityTeam securityTeam) throws InternalErrorException, PrivilegeException, FacilityNotExistsException, SecurityTeamNotExistsException, SecurityTeamAlreadyAssignedException;

	/**
	 * Remove (Unassign) given security team from given facility
	 *
	 * @param sess
	 * @param facility
	 * @param securityTeam
	 * @throws InternalErrorException
	 * @throws PrivilegeException can do only PerunAdmin or FacilityAdmin of the facility
	 * @throws FacilityNotExistsException
	 * @throws SecurityTeamNotExistsException
	 * @throws SecurityTeamNotAssignedException
	 */
	void removeSecurityTeam(PerunSession sess, Facility facility, SecurityTeam securityTeam) throws InternalErrorException, PrivilegeException, FacilityNotExistsException, SecurityTeamNotExistsException, SecurityTeamNotAssignedException;

}


text:
package org.apache.atlas.catalog.definition;

import com.tinkerpop.pipes.PipeFunction;
import com.tinkerpop.pipes.transform.TransformFunctionPipe;
import org.apache.atlas.catalog.Request;
import org.apache.atlas.catalog.ResourceComparator;
import org.apache.atlas.catalog.TermPath;
import org.apache.atlas.catalog.VertexWrapper;
import org.apache.atlas.catalog.exception.InvalidPayloadException;
import org.apache.atlas.catalog.projection.Projection;
import org.apache.atlas.catalog.projection.ProjectionResult;
import org.apache.atlas.repository.Constants;
import org.apache.atlas.typesystem.types.*;
import org.apache.atlas.typesystem.types.utils.TypesUtil;

import java.util.*;

/**
 * Term resource definition.
 */
public class TermResourceDefinition extends BaseResourceDefinition {
    public TermResourceDefinition() {
        registerProperty(TypesUtil.createRequiredAttrDef("name", DataTypes.STRING_TYPE));
        registerProperty(TypesUtil.createOptionalAttrDef("description", DataTypes.STRING_TYPE));
        registerProperty(TypesUtil.createOptionalAttrDef("available_as_tag", DataTypes.BOOLEAN_TYPE));
        registerProperty(TypesUtil.createOptionalAttrDef("acceptable_use", DataTypes.STRING_TYPE));

        instanceProperties.add("name");
        instanceProperties.add("description");
        instanceProperties.add("creation_time");
        instanceProperties.add("available_as_tag");
        instanceProperties.add("acceptable_use");

        collectionProperties.add("name");
        collectionProperties.add("description");

        projections.put("terms", getSubTermProjection());
        projections.put("hierarchy", getHierarchyProjection());
    }

    @Override
    public void validateCreatePayload(Request request) throws InvalidPayloadException {
        super.validateCreatePayload(request);

        String name = request.getProperty("name");
        // name will be in the fully qualified form: taxonomyName.termName
        if (! name.contains(".")) {
            throw new InvalidPayloadException("Term name must be in the form 'taxonomyName.termName.subTermName'");
        }

        if (! request.getQueryProperties().containsKey("available_as_tag")) {
            request.getQueryProperties().put("available_as_tag", true);
        }
    }

    @Override
    public String getTypeName() {
        return "Term";
    }

    @Override
    public String getIdPropertyName() {
        return "name";
    }

    //todo
    @Override
    public String resolveHref(Map<String, Object> properties) {
        StringBuilder sb = new StringBuilder();
        sb.append("v1/taxonomies/");

        TermPath termPath = new TermPath(String.valueOf(properties.get("name")));
        String[] paths = termPath.getPathSegments();
        sb.append(termPath.getTaxonomyName());

        for (String path : paths) {
            //todo: shouldn't need to check for null or empty after TermPath addition
            if (path != null && !path.isEmpty()) {
                sb.append("/terms/");
                sb.append(path);
            }
        }

        return sb.toString();
    }

    private Projection getHierarchyProjection() {
        final String projectionName = "hierarchy";
        return new Projection(projectionName, Projection.Cardinality.SINGLE,
                new TransformFunctionPipe<>(new PipeFunction<VertexWrapper, Collection<ProjectionResult>>() {
                    @Override
                    public Collection<ProjectionResult> compute(VertexWrapper start) {
                        Map<String, Object> map = new TreeMap<>(new ResourceComparator());

                        TermPath termPath = new TermPath(start.getVertex().<String>getProperty(
                                Constants.ENTITY_TYPE_PROPERTY_KEY));

                        map.put("path", termPath.getPath());
                        map.put("short_name", termPath.getShortName());
                        map.put("taxonomy", termPath.getTaxonomyName());

                        return Collections.singleton(new ProjectionResult(projectionName, start,
                                Collections.singleton(map)));
                    }
                }));

    }

    private Projection getSubTermProjection() {
        //todo: combine with other term projections
        final String termsProjectionName = "terms";
        return new Projection(termsProjectionName, Projection.Cardinality.SINGLE,
                new TransformFunctionPipe<>(new PipeFunction<VertexWrapper, Collection<ProjectionResult>>() {
                    @Override
                    public Collection<ProjectionResult> compute(VertexWrapper start) {
                        Map<String, Object> map = new TreeMap<>(new ResourceComparator());

                        StringBuilder sb = new StringBuilder();
                        sb.append("v1/taxonomies/");

                        TermPath termPath = new TermPath(start.getVertex().<String>getProperty(Constants.ENTITY_TYPE_PROPERTY_KEY));
                        String[] paths = termPath.getPathSegments();
                        sb.append(termPath.getTaxonomyName());

                        for (String path : paths) {
                            //todo: shouldn't need to check for null or empty after TermPath addition
                            if (path != null && !path.isEmpty()) {
                                sb.append("/terms/");
                                sb.append(path);
                            }
                        }
                        sb.append("/terms");

                        map.put("href", sb.toString());
                        return Collections.singleton(new ProjectionResult(termsProjectionName, start,
                                Collections.singleton(map)));
                    }
                }));
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    tools:context=".MainActivity">

    <LinearLayout
        android:id="@+id/section_tabs"
        android:layout_width="match_parent"
        android:layout_height="65dp"
        android:layout_alignParentBottom="true"
        android:background="#00000000"
        android:divider="@color/font_shadow"
        android:orientation="horizontal" />

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@id/section_tabs">

        <android.support.v4.view.ViewPager
            android:id="@+id/view_pager"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

    </FrameLayout>
</RelativeLayout>


text:
from .Observation import Observation

class Constant(Observation):
  ''' constant is for constant variables that have types
  or indices associated with them like types of clouds, etc'''
  MISSING = ["99"]

  def __str__(self):
    if self._obs_value in self._obs_index.keys():
      return self._obs_index.get(self._obs_value)
    elif self._obs_value in self.MISSING:
      return 'MISSING'
    else:
      return str(self._obs_value)

  def __repr__(self):
    return repr(self.__str__())

  def __eq__(self, value2):
    return("P")
    if self._obs_value in self._obs_index.keys():
      if self._obs_index.get(self._obs_value) == value2:
        return True

    if str(self) == str(value2):
      return True
    else:
      return False


text:
#if !NO_RUNTIME
using System;
using ProtoBuf.Meta;

#if FEAT_IKVM
using Type = IKVM.Reflection.Type;
using IKVM.Reflection;
#else
using System.Reflection;
#endif

namespace ProtoBuf.Serializers
{
    sealed class SurrogateSerializer : IProtoTypeSerializer
    {
        bool IProtoTypeSerializer.HasCallbacks(ProtoBuf.Meta.TypeModel.CallbackType callbackType) { return false; }
#if FEAT_COMPILER
        void IProtoTypeSerializer.EmitCallback(Compiler.CompilerContext ctx, Compiler.Local valueFrom, ProtoBuf.Meta.TypeModel.CallbackType callbackType) { }
        void IProtoTypeSerializer.EmitCreateInstance(Compiler.CompilerContext ctx) { throw new NotSupportedException(); }
#endif
        bool IProtoTypeSerializer.CanCreateInstance() { return false; }
#if !FEAT_IKVM
        object IProtoTypeSerializer.CreateInstance(ProtoReader source) { throw new NotSupportedException(); }
        void IProtoTypeSerializer.Callback(object value, ProtoBuf.Meta.TypeModel.CallbackType callbackType, SerializationContext context) { }
#endif

        public bool ReturnsValue { get { return false; } }
        public bool RequiresOldValue { get { return true; } }
        public Type ExpectedType { get { return forType; } }
        private readonly Type forType, declaredType;
        private readonly MethodInfo toTail, fromTail;
        IProtoTypeSerializer rootTail;

        public SurrogateSerializer(TypeModel model, Type forType, Type declaredType, IProtoTypeSerializer rootTail)
        {
            Helpers.DebugAssert(forType != null, "forType");
            Helpers.DebugAssert(declaredType != null, "declaredType");
            Helpers.DebugAssert(rootTail != null, "rootTail");
            Helpers.DebugAssert(rootTail.RequiresOldValue, "RequiresOldValue");
            Helpers.DebugAssert(!rootTail.ReturnsValue, "ReturnsValue");
            Helpers.DebugAssert(declaredType == rootTail.ExpectedType || Helpers.IsSubclassOf(declaredType, rootTail.ExpectedType));
            this.forType = forType;
            this.declaredType = declaredType;
            this.rootTail = rootTail;
            toTail = GetConversion(model, true);
            fromTail = GetConversion(model, false);
        }
        private static bool HasCast(TypeModel model, Type type, Type from, Type to, out MethodInfo op)
        {
#if WINRT
            System.Collections.Generic.List<MethodInfo> list = new System.Collections.Generic.List<MethodInfo>();
            foreach (var item in type.GetRuntimeMethods())
            {
                if (item.IsStatic) list.Add(item);
            }
            MethodInfo[] found = list.ToArray();
#else
            const BindingFlags flags = BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;
            MethodInfo[] found = type.GetMethods(flags);
#endif
            ParameterInfo[] paramTypes;
            Type convertAttributeType = null;
            for (int i = 0; i < found.Length; i++)
            {
                MethodInfo m = found[i];
                if (m.ReturnType != to) continue;
                paramTypes = m.GetParameters();
                if(paramTypes.Length == 1 && paramTypes[0].ParameterType == from)
                {
                    if (convertAttributeType == null)
                    {
                        convertAttributeType = model.MapType(typeof(ProtoConverterAttribute), false);
                        if (convertAttributeType == null)
                        { // attribute isn't defined in the source assembly: stop looking
                            break;
                        }
                    }
                    if (m.IsDefined(convertAttributeType, true))
                    {
                        op = m;
                        return true;
                    }
                }
            }

            for(int i = 0 ; i < found.Length ; i++)
            {
                MethodInfo m = found[i];
                if ((m.Name != "op_Implicit" && m.Name != "op_Explicit") || m.ReturnType != to)
                {
                    continue;
                }
                paramTypes = m.GetParameters();
                if(paramTypes.Length == 1 && paramTypes[0].ParameterType == from)
                {
                    op = m;
                    return true;
                }
            }
            op = null;
            return false;
        }

        public MethodInfo GetConversion(TypeModel model, bool toTail)
        {
            Type to = toTail ? declaredType : forType;
            Type from = toTail ? forType : declaredType;
            MethodInfo op;
            if (HasCast(model, declaredType, from, to, out op) || HasCast(model, forType, from, to, out op))
            {
                return op;
            }
            throw new InvalidOperationException("No suitable conversion operator found for surrogate: " +
                forType.FullName + " / " + declaredType.FullName);
        }

#if !FEAT_IKVM
        public void Write(object value, ProtoWriter writer)
        {
            rootTail.Write(toTail.Invoke(null, new object[] { value }), writer);
        }
        public object Read(object value, ProtoReader source)
        {
            // convert the incoming value
            object[] args = { value };
            value = toTail.Invoke(null, args);

            // invoke the tail and convert the outgoing value
            args[0] = rootTail.Read(value, source);
            return fromTail.Invoke(null, args);
        }
#endif

#if FEAT_COMPILER
        void IProtoSerializer.EmitRead(Compiler.CompilerContext ctx, Compiler.Local valueFrom)
        {
            Helpers.DebugAssert(valueFrom != null); // don't support stack-head for this
            using (Compiler.Local converted = new Compiler.Local(ctx, declaredType)) // declare/re-use local
            {
                ctx.LoadValue(valueFrom); // load primary onto stack
                ctx.EmitCall(toTail); // static convert op, primary-to-surrogate
                ctx.StoreValue(converted); // store into surrogate local

                rootTail.EmitRead(ctx, converted); // downstream processing against surrogate local

                ctx.LoadValue(converted); // load from surrogate local
                ctx.EmitCall(fromTail);  // static convert op, surrogate-to-primary
                ctx.StoreValue(valueFrom); // store back into primary
            }
        }

        void IProtoSerializer.EmitWrite(Compiler.CompilerContext ctx, Compiler.Local valueFrom)
        {
            ctx.LoadValue(valueFrom);
            ctx.EmitCall(toTail);
            rootTail.EmitWrite(ctx, null);
        }
#endif
    }
}
#endif


text:
using Ghost.Server.Core.Classes;
using System.Collections.Generic;

namespace Ghost.Server.Core.Structs
{
    public struct DB_Dialog
    {
        public readonly ushort Id;

        public readonly SortedDictionary<short, DialogEntry> Entries;

        public DB_Dialog(ushort id)
        {
            Id = id;
            Entries = new SortedDictionary<short, DialogEntry>();
        }
    }
}


text:
package com.intland.jenkins.jacoco;

import java.io.IOException;
import java.net.URL;

import org.junit.Assert;
import org.junit.Test;

import com.intland.jenkins.coverage.model.CoverageReport;

public class JacocoResultParserTests {

	@Test
	public void testCollectCoverageReport() throws IOException {
		URL resource = this.getClass().getResource("/jacoco.xml");

		JacocoResultParser parser = new JacocoResultParser();
		CoverageReport collectCoverageReport = parser.collectCoverageReport(resource.getPath(), null);

		Integer lineCoverage = collectCoverageReport.getLineCovered();
		Assert.assertEquals(Double.valueOf(18d), Double.valueOf(lineCoverage.toString()));
	}
}


text:
package org.strucdocs.component.document.content;

import lombok.Cleanup;
import lombok.RequiredArgsConstructor;

import org.apache.commons.codec.digest.DigestUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.multipart.MultipartFile;
import org.strucdocs.component.document.exception.DocumentException;
import org.strucdocs.component.document.exception.DocumentNotFoundException;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;

@Service
@RequiredArgsConstructor
class FileStoreService {

    private final File root;

    boolean exists(String digest) {
        return new File(root, digest).exists();
    }

    InputStream get(String digest) {
        try {
            File file = new File(root, digest);
            return new BufferedInputStream(new FileInputStream(file));
        } catch (IOException ex) {
            throw new DocumentException(ex);
        }
    }

    File save(MultipartFile uploadedFile) {
        try {
            String digest = getSha1Digest(uploadedFile.getInputStream());
            File file = new File(root, digest);
            @Cleanup
            BufferedOutputStream stream = new BufferedOutputStream(new FileOutputStream(file));
            FileCopyUtils.copy(uploadedFile.getInputStream(), stream);
            return file;
        } catch (IOException ex) {
            throw new DocumentException(ex);
        }
    }

    boolean delete(String digest) {
        File f = new File(root, digest);
        if (!f.exists()) {
            throw new DocumentNotFoundException(
                String.format("Unable to delete non-existing file %s", digest)
            );
        }
        return f.delete();
    }

    private String getSha1Digest(InputStream is) {
        try {
            return DigestUtils.sha1Hex(is);
        } catch (IOException ex) {
            throw new IllegalStateException(ex);
        }
    }
}


text:
using System;

namespace BitCoinSharp
{
    ///
    /// A BitCoin address is fundamentally derived from an elliptic curve public key and a set of network parameters.
    ///
    /// <remarks>
    /// It has several possible representations:

    ///

    ///
The raw public key bytes themselves.

    ///
RIPEMD160 hash of the public key bytes.

    ///
A base58 encoded "human form" that includes a version and check code, to guard against typos.

    ///

    /// One may question whether the base58 form is really an improvement over the hash160 form, given
    /// they are both very unfriendly for typists. More useful representations might include QR codes
    /// and identicons.

    /// Note that an address is specific to a network because the first byte is a discriminator value.
    /// </remarks>
    public class Address : VersionedChecksummedBytes
    {
        ///
        /// Construct an address from parameters and the hash160 form.
        ///
        /// <remarks>
        /// Example:

        ///
new Address(NetworkParameters.prodNet(), Hex.decode("4a22c3c4cbb31e4d03b15550636762bda0baf85a"));

        /// </remarks>
        public Address(NetworkParameters @params, byte[] hash160)
            : base(@params.AddressHeader, hash160)
        {
            if (hash160.Length != 20) // 160 = 8 * 20
                throw new ArgumentException("Addresses are 160-bit hashes, so you must provide 20 bytes", "hash160");
        }

        ///
        /// Construct an address from parameters and the standard "human readable" form.
        ///
        /// <remarks>
        /// Example:

        ///
new Address(NetworkParameters.prodNet(), "17kzeh4N8g49GFvdDzSf8PjaPfyoD1MndL");

        /// </remarks>
        /// <exception cref="AddressFormatException"/>
        public Address(NetworkParameters @params, string address)
            : base(address)
        {
            if (Version != @params.AddressHeader)
                throw new AddressFormatException("Mismatched version number, trying to cross networks? " + Version +
                                                 " vs " + @params.AddressHeader);
        }

        ///
        /// The (big endian) 20 byte hash that is the core of a BitCoin address.
        ///
        public byte[] Hash160
        {
            get { return Bytes; }
        }
    }
}


text:
lua-resty-murmurhash2 is MurmurHash 2 library (LuaJIT bindings) for OpenResty's / Nginx's murmurhash2 implementation.

## Lua API
#### number require "resty.murmurhash2" string

This module has only one function that you can get just by requiring this module:

```lua
local mmh2 = require "resty.murmurhash2"
local hash = mmh2 "test" -- hash contains number 403862830
```

## License

`lua-resty-session` uses two clause BSD license.

```
Copyright (c) 2014, Aapo Talvensaari
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
  list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice, this
  list of conditions and the following disclaimer in the documentation and/or
  other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
```