本文整理汇总了Java中gov.nih.nci.security.authorization.domainobjects.ProtectionElement.setProtectionElementName方法的典型用法代码示例。如果您正苦于以下问题:Java ProtectionElement.setProtectionElementName方法的具体用法?Java ProtectionElement.setProtectionElementName怎么用?Java ProtectionElement.setProtectionElementName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gov.nih.nci.security.authorization.domainobjects.ProtectionElement
的用法示例。
在下文中一共展示了ProtectionElement.setProtectionElementName方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testCreateProtectionElement
import gov.nih.nci.security.authorization.domainobjects.ProtectionElement; //导入方法依赖的package包/类
private void testCreateProtectionElement() throws CSTransactionException
{
for (int x=0; x<NumberOfProtectionElementsToTest; x++)
{
ProtectionElement tempProtectionElement = new ProtectionElement();
java.util.Date CurrentTime = new java.util.Date();
tempProtectionElement.setProtectionElementName(ProtectionElementStringArray[x][0]);
tempProtectionElement.setProtectionElementDescription(ProtectionElementStringArray[x][1]);
tempProtectionElement.setObjectId(ProtectionElementStringArray[x][2]);
tempProtectionElement.setAttribute(ProtectionElementStringArray[x][3]);
tempProtectionElement.setUpdateDate(CurrentTime);
userProvisioningManager.createProtectionElement(tempProtectionElement);
tempProtectionElement = null;
}
}
示例2: testCreateProtectionElement
import gov.nih.nci.security.authorization.domainobjects.ProtectionElement; //导入方法依赖的package包/类
private void testCreateProtectionElement() throws CSTransactionException
{
for (int x = 0; x < NumberOfProtectionElementsToTest; x++)
{
ProtectionElement tempProtectionElement = new ProtectionElement();
java.util.Date CurrentTime = new java.util.Date();
tempProtectionElement.setProtectionElementName(ProtectionElementStringArray[x][0]);
tempProtectionElement.setProtectionElementDescription(ProtectionElementStringArray[x][1]);
tempProtectionElement.setObjectId(ProtectionElementStringArray[x][2]);
tempProtectionElement.setAttribute(ProtectionElementStringArray[x][3]);
tempProtectionElement.setUpdateDate(CurrentTime);
userProvisioningManager.createProtectionElement(tempProtectionElement);
tempProtectionElement = null;
}
}
示例3: testRemoveProtectionElement
import gov.nih.nci.security.authorization.domainobjects.ProtectionElement; //导入方法依赖的package包/类
private void testRemoveProtectionElement() throws CSTransactionException
{
try
{
for (int x = 0; x < NumberOfProtectionElementsToTest; x++)
{
ProtectionElement obj = new ProtectionElement();
obj.setProtectionElementName(ProtectionElementStringArray[x][0]);
SearchCriteria sc = new ProtectionElementSearchCriteria(obj);
List objList = userProvisioningManager.getObjects(sc);
userProvisioningManager.removeProtectionElement(((ProtectionElement) objList.get(0)).getProtectionElementId().toString());
}
assertTrue(true);
}
catch (Exception e)
{
assertTrue(false);
}
}
示例4: testGetProtectionElementById
import gov.nih.nci.security.authorization.domainobjects.ProtectionElement; //导入方法依赖的package包/类
private void testGetProtectionElementById() throws CSObjectNotFoundException
{
try
{
for (int x = 0; x < NumberOfProtectionElementsToTest; x++)
{
ProtectionElement obj = new ProtectionElement();
obj.setProtectionElementName(ProtectionElementStringArray[x][0]);
SearchCriteria sc = new ProtectionElementSearchCriteria(obj);
List appList = userProvisioningManager.getObjects(sc);
ProtectionElement tempProtectionElement = userProvisioningManager.getProtectionElementById(((ProtectionElement) appList.get(0)).getProtectionElementId().toString());
AssertEqualsForProtectionElements(x, tempProtectionElement);
}
assertTrue(true);
}
catch (Exception e)
{
assertTrue(false);
}
}
示例5: testEquality
import gov.nih.nci.security.authorization.domainobjects.ProtectionElement; //导入方法依赖的package包/类
public void testEquality() {
assertTrue(protectionElement1.equals(protectionElement1copy));
assertFalse(protectionElement1.equals(protectionElement2));
assertFalse(protectionElement1.equals(protectionElement3));
ProtectionElement protectionElement1subtype = new ProtectionElement() {
};
protectionElement1subtype.setProtectionElementId(new Long(4));
protectionElement1subtype.setProtectionElementName("ProtectionElement4");
assertFalse(protectionElement1.equals(protectionElement1subtype));
assertReflexivity();
assertSymmetry();
assertTransitivity();
assertConsistency();
assertNullComparison();
}
示例6: testModifyProtectionElement
import gov.nih.nci.security.authorization.domainobjects.ProtectionElement; //导入方法依赖的package包/类
private void testModifyProtectionElement() throws CSTransactionException, CSObjectNotFoundException
{
ProtectionElement tempProtectionElement = new ProtectionElement();
java.util.Date midnight_jan2_1970 = new java.util.Date(24L*60L*60L*1000L);
tempProtectionElement = userProvisioningManager.getProtectionElementById("4");
tempProtectionElement.setProtectionElementName(ProtectionElementStringArray[3][0] + "Modified");
tempProtectionElement.setProtectionElementDescription(ProtectionElementStringArray[3][1] + "Modified");
tempProtectionElement.setObjectId(ProtectionElementStringArray[3][2] + "Modified");
tempProtectionElement.setAttribute(ProtectionElementStringArray[3][3] + "Modified");
tempProtectionElement.setUpdateDate(midnight_jan2_1970); //TODO: Not updating the "Update Date"
userProvisioningManager.modifyProtectionElement(tempProtectionElement);
tempProtectionElement = userProvisioningManager.getProtectionElementById("4");
assertEquals("\nmodifyProtectionElement did not modify the Name\n", ProtectionElementStringArray[3][0] + "Modified", tempProtectionElement.getProtectionElementName());
assertEquals("\nmodifyProtectionElement did not modify the Description\n", ProtectionElementStringArray[3][1] + "Modified", tempProtectionElement.getProtectionElementDescription());
assertEquals("\nmodifyProtectionElement did not modify the Object ID\n", ProtectionElementStringArray[3][2] + "Modified", tempProtectionElement.getObjectId());
assertEquals("\nmodifyProtectionElement did not modify the Attribute\n", ProtectionElementStringArray[3][3] + "Modified", tempProtectionElement.getAttribute());
}
示例7: testCreateProtectionElement
import gov.nih.nci.security.authorization.domainobjects.ProtectionElement; //导入方法依赖的package包/类
private static void testCreateProtectionElement() throws CSTransactionException
{
for (int x=0; x<NumberOfProtectionElementsToTest; x++)
{
ProtectionElement tempProtectionElement = new ProtectionElement();
java.util.Date CurrentTime = new java.util.Date();
tempProtectionElement.setProtectionElementName(ProtectionElementStringArray[x][0]);
tempProtectionElement.setProtectionElementDescription(ProtectionElementStringArray[x][1]);
tempProtectionElement.setObjectId(ProtectionElementStringArray[x][2]);
tempProtectionElement.setAttribute(ProtectionElementStringArray[x][3]);
tempProtectionElement.setUpdateDate(CurrentTime);
userProvisioningManager.createProtectionElement(tempProtectionElement);
tempProtectionElement = null;
}
}
示例8: testCreateProtectionElement
import gov.nih.nci.security.authorization.domainobjects.ProtectionElement; //导入方法依赖的package包/类
private static void testCreateProtectionElement() throws CSTransactionException
{
for (int x=0; x<NumberOfProtectionElementsToTest; x++)
{
ProtectionElement tempProtectionElement = new ProtectionElement();
java.util.Date CurrentTime = new java.util.Date();
tempProtectionElement.setProtectionElementName(ProtectionElementStringArray[x][0]);
tempProtectionElement.setProtectionElementDescription(ProtectionElementStringArray[x][1]);
tempProtectionElement.setObjectId(ProtectionElementStringArray[x][2]);
tempProtectionElement.setAttribute(ProtectionElementStringArray[x][3]);
tempProtectionElement.setUpdateDate(CurrentTime);
userProvisioningManager.createProtectionElement(tempProtectionElement);
tempProtectionElement = null;
}
}
示例9: createUptOperationProtectionElement
import gov.nih.nci.security.authorization.domainobjects.ProtectionElement; //导入方法依赖的package包/类
private ProtectionElement createUptOperationProtectionElement(UserProvisioningManager upManager, String objectId, Application application) throws CSTransactionException
{
ProtectionElement pe = new ProtectionElement();
String peName=Constants.UPT_OPERATION_DISABLE_FLAG+":"+objectId;
pe.setProtectionElementName(peName);
pe.setObjectId(objectId);
String peDesc="System required protection element :"+objectId +"'\n Do not change its unique object ID.";
pe.setProtectionElementDescription(peDesc);
upManager.createProtectionElement(pe);
// pe has been as to current application
//set it to target application
pe.setApplication(application);
upManager.modifyProtectionElement(pe);
return pe;
}
示例10: setUp
import gov.nih.nci.security.authorization.domainobjects.ProtectionElement; //导入方法依赖的package包/类
protected void setUp() {
protectionElement1 = new ProtectionElement();
protectionElement1.setProtectionElementId(new Long(1));
protectionElement1.setProtectionElementName("ProtectionElement1");
protectionElement1copy = new ProtectionElement();
protectionElement1copy.setProtectionElementId(new Long(1));
protectionElement1copy.setProtectionElementName("ProtectionElement1");
protectionElement1copy2 = new ProtectionElement();
protectionElement1copy2.setProtectionElementId(new Long(1));
protectionElement1copy2.setProtectionElementName("ProtectionElement1");
protectionElement2 = new ProtectionElement();
protectionElement2.setProtectionElementId(new Long(2));
protectionElement2.setProtectionElementName("ProtectionElement2");
protectionElement3 = new ProtectionElement();
protectionElement3.setProtectionElementId(new Long(3));
protectionElement3.setProtectionElementName("ProtectionElement3");
}
示例11: xtestModifyProtectionElement
import gov.nih.nci.security.authorization.domainobjects.ProtectionElement; //导入方法依赖的package包/类
private void xtestModifyProtectionElement() throws CSTransactionException, CSObjectNotFoundException
{
ProtectionElement tempProtectionElement = new ProtectionElement();
java.util.Date midnight_jan2_1970 = new java.util.Date(24L*60L*60L*1000L);
tempProtectionElement = userProvisioningManager.getProtectionElementById("4");
tempProtectionElement.setProtectionElementName(ProtectionElementStringArray[3][0] + "Modified");
tempProtectionElement.setProtectionElementDescription(ProtectionElementStringArray[3][1] + "Modified");
tempProtectionElement.setObjectId(ProtectionElementStringArray[3][2] + "Modified");
tempProtectionElement.setAttribute(ProtectionElementStringArray[3][3] + "Modified");
tempProtectionElement.setUpdateDate(midnight_jan2_1970); //TODO: Not updating the "Update Date"
userProvisioningManager.modifyProtectionElement(tempProtectionElement);
tempProtectionElement = userProvisioningManager.getProtectionElementById("4");
assertEquals("\nmodifyProtectionElement did not modify the Name\n", ProtectionElementStringArray[3][0] + "Modified", tempProtectionElement.getProtectionElementName());
assertEquals("\nmodifyProtectionElement did not modify the Description\n", ProtectionElementStringArray[3][1] + "Modified", tempProtectionElement.getProtectionElementDescription());
assertEquals("\nmodifyProtectionElement did not modify the Object ID\n", ProtectionElementStringArray[3][2] + "Modified", tempProtectionElement.getObjectId());
assertEquals("\nmodifyProtectionElement did not modify the Attribute\n", ProtectionElementStringArray[3][3] + "Modified", tempProtectionElement.getAttribute());
}
示例12: createProtectionElement
import gov.nih.nci.security.authorization.domainobjects.ProtectionElement; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void createProtectionElement(StudyConfiguration studyConfiguration,
AuthorizedStudyElementsGroup authorizedStudyElementsGroup) throws CSException {
if (doesUserExist(studyConfiguration.getUserWorkspace().getUsername())) {
User user = retrieveCsmUser(studyConfiguration.getUserWorkspace().getUsername());
ProtectionElement element = createProtectionElementInstance(authorizedStudyElementsGroup);
if (element == null) {
throw new CSInsufficientAttributesException();
} else {
Group authorizedGroup = authorizedStudyElementsGroup.getAuthorizedGroup();
element.setProtectionElementName(authorizedGroup.getGroupName());
Set<User> owners = new HashSet<User>();
owners.add(user);
element.setOwners(owners);
Set<ProtectionGroup> protectionGroups = new HashSet<ProtectionGroup>();
protectionGroups.addAll(retrieveProtectionGroups(authorizedGroup, STUDY_INVESTIGATOR_ROLE));
protectionGroups.addAll(retrieveProtectionGroups(authorizedGroup, STUDY_MANAGER_ROLE));
element.setProtectionGroups(protectionGroups);
getAuthorizationManager().createProtectionElement(element);
}
}
}
示例13: createProtectionElement
import gov.nih.nci.security.authorization.domainobjects.ProtectionElement; //导入方法依赖的package包/类
/**
* Test method: void createPrivilege(Privilege)
*/
protected ProtectionElement createProtectionElement() throws CSTransactionException {
ProtectionElement pe = new ProtectionElement();
pe.setObjectId( "" + System.currentTimeMillis() );
pe.setProtectionElementDescription( "Test Desc");
pe.setProtectionElementName( "Test PE Name" + System.currentTimeMillis());
upm.createProtectionElement( pe );
System.out.println("Created PE with ID: " + pe.getProtectionElementId() );
return pe;
}
示例14: doAuthorization
import gov.nih.nci.security.authorization.domainobjects.ProtectionElement; //导入方法依赖的package包/类
/**
* Method performs the following authorization: Creates a protection element
* that represents the employee record Creates the employee protection
* element to protected the Employee's data Create a User in the security
* schema for Authorization Assigns the employee to a business unit Assigns
* the employee as the owner of their record Assigns full access to HR
* Managers only
*
* @param request
* @param empl
* @throws CSException
*/
private void doAuthorization(HttpServletRequest request, Employee empl)
throws Exception {
try {
//Create a protection element that represents the employee record
ProtectionElement pe = new ProtectionElement();
pe.setObjectId(SecurityUtils.getEmployeeObjectId(empl));
pe.setProtectionElementName("EMPLOYEE_RECORD_"
+ empl.getEmployeeId());
pe
.setProtectionElementDescription("The gov.nih.nci.security.ri.valueObject.Employee Object");
//create the employee protection element to protected the
//employee's data
getAuthorizationManager().createProtectionElement(pe);
//Create the User for Authorization
User user = createUser(empl);
//Assign the User to the appropriate UserGroup
getUserProvisioningManager().assignUserToGroup(user.getLoginName(),
SecurityUtils.getEmployeeGroup(empl));
//assign the employee as owner of record
getAuthorizationManager().setOwnerForProtectionElement(
user.getLoginName(), pe.getObjectId(), null);
//assign the employee to his business unit
getAuthorizationManager().assignProtectionElement(
empl.getBusinessUnit(), pe.getObjectId());
//If they are not part of HR division then add
//employee record so that HR managers can view
//all employee data
if (!HR_DIVISION.equals(empl.getBusinessUnit())) {
//assign access to the employee for HR Division
getAuthorizationManager().assignProtectionElement(HR_DIVISION,
pe.getObjectId());
}
} catch (CSException ex) {
log
.fatal(
"The Security Service encountered a fatal exception.",
ex);
throw new Exception(
"The Security Service encountered a fatal exception.", ex);
}
}