use of cz.metacentrum.perun.core.api.ExtSource in project perun by CESNET.
the class urn_perun_group_resource_attribute_def_def_isUnixGroupIntegrationtest method setUpUserExtSource.
private void setUpUserExtSource() throws Exception {
ExtSource externalSource = perun.getExtSourcesManager().getExtSourceByName(sess, extSourceName);
// gets real external source object from database
userExtSource.setExtSource(externalSource);
// put real external source into user's external source
userExtSource.setLogin(extLogin);
// set users login in his ext source
assertNotNull(usersManager.addUserExtSource(sess, user, userExtSource));
// create new user ext source in database
}
use of cz.metacentrum.perun.core.api.ExtSource in project perun by CESNET.
the class VosManagerEntryIntegrationTest method setUp.
@Before
public void setUp() throws Exception {
vosManagerEntry = perun.getVosManager();
myVo = new Vo(0, voName, voShortName);
ExtSource newExtSource = new ExtSource(extSourceName, ExtSourcesManager.EXTSOURCE_INTERNAL);
es = perun.getExtSourcesManager().createExtSource(sess, newExtSource, null);
}
use of cz.metacentrum.perun.core.api.ExtSource in project perun by CESNET.
the class UsersManagerEntryIntegrationTest method setUpVo.
private Vo setUpVo() throws Exception {
Vo newVo = new Vo(0, "UserManagerTestVo", "UMTestVo");
Vo returnedVo = perun.getVosManager().createVo(sess, newVo);
// create test VO in database
assertNotNull("unable to create testing Vo", returnedVo);
assertEquals("both VOs should be the same", newVo, returnedVo);
ExtSource newExtSource = new ExtSource(extSourceName, ExtSourcesManager.EXTSOURCE_INTERNAL);
ExtSource es = perun.getExtSourcesManager().createExtSource(sess, newExtSource, null);
// get and create real external source from DB
perun.getExtSourcesManager().addExtSource(sess, returnedVo, es);
return returnedVo;
}
use of cz.metacentrum.perun.core.api.ExtSource in project perun by CESNET.
the class UsersManagerEntryIntegrationTest method getUserExtSourceByExtLoginWhenExtSourceNotExists.
@Test(expected = ExtSourceNotExistsException.class)
public void getUserExtSourceByExtLoginWhenExtSourceNotExists() throws Exception {
System.out.println(CLASS_NAME + "getUserExtSourceByExtLoginWhenExtSourceNotExists");
usersManager.getUserExtSourceByExtLogin(sess, new ExtSource(), "");
}
use of cz.metacentrum.perun.core.api.ExtSource in project perun by CESNET.
the class MembersManagerBlImpl method createMember.
/*
* This method finally has to call this.createMember(PerunSession sess, Vo vo, UserExtSource userExtSource)
* @see cz.metacentrum.perun.core.api.MembersManager#createMember(cz.metacentrum.perun.core.api.PerunSession, cz.metacentrum.perun.core.api.Vo, java.lang.String, java.lang.String, java.lang.String, cz.metacentrum.perun.core.api.Candidate)
*/
public Member createMember(PerunSession sess, Vo vo, String extSourceName, String extSourceType, String login, Candidate candidate, List<Group> groups) throws InternalErrorException, WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, ExtendMembershipException, GroupOperationsException {
// Create ExtSource object
ExtSource extSource = new ExtSource();
extSource.setName(extSourceName);
extSource.setType(extSourceType);
// Create UserExtSource object
UserExtSource userExtSource = new UserExtSource();
userExtSource.setLogin(login);
userExtSource.setExtSource(extSource);
// Set all above data to the candidate's userExtSource
candidate.setUserExtSource(userExtSource);
return this.createMember(sess, vo, candidate, groups);
}
Aggregations