当前位置: 首页>>代码示例>>Java>>正文


Java ProtectionElement.setAttribute方法代码示例

本文整理汇总了Java中gov.nih.nci.security.authorization.domainobjects.ProtectionElement.setAttribute方法的典型用法代码示例。如果您正苦于以下问题:Java ProtectionElement.setAttribute方法的具体用法?Java ProtectionElement.setAttribute怎么用?Java ProtectionElement.setAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gov.nih.nci.security.authorization.domainobjects.ProtectionElement的用法示例。


在下文中一共展示了ProtectionElement.setAttribute方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
	}
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:18,代码来源:UserProvisioningManagerTest.java

示例2: 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());
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:23,代码来源:UserProvisioningManagerTest.java

示例3: 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;
	}
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:18,代码来源:RegressionTest.java

示例4: 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;
	}
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:18,代码来源:PrimeCSMData.java

示例5: xtestCreateProtectionElement

import gov.nih.nci.security.authorization.domainobjects.ProtectionElement; //导入方法依赖的package包/类
private void xtestCreateProtectionElement() throws CSTransactionException 
{
	for (int x=0; x<NumberOfProtectionElementsToxtest; 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;
	}
}
 
开发者ID:NCIP,项目名称:common-security-module,代码行数:18,代码来源:UserProvisioningManagerTest.java

示例6: 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());
}
 
开发者ID:NCIP,项目名称:common-security-module,代码行数:23,代码来源:UserProvisioningManagerTest.java

示例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;
	}
}
 
开发者ID:NCIP,项目名称:common-security-module,代码行数:18,代码来源:PrimeCSMData.java

示例8: searchObjects

import gov.nih.nci.security.authorization.domainobjects.ProtectionElement; //导入方法依赖的package包/类
public SearchResult searchObjects(UserProvisioningManager userProvisioningManager) throws Exception 
{
	ProtectionElement protectionElement = new ProtectionElement();
	
	if (this.protectionElementName != null && !(this.protectionElementName.trim().equalsIgnoreCase("")))
		protectionElement.setProtectionElementName(this.protectionElementName);
	if (this.protectionElementType != null && !(this.protectionElementType.trim().equalsIgnoreCase("")))
		protectionElement.setProtectionElementType(this.protectionElementType);
	if (this.protectionElementObjectId != null && !(this.protectionElementObjectId.trim().equalsIgnoreCase("")))
		protectionElement.setObjectId(this.protectionElementObjectId);
	if (this.protectionElementAttribute != null && !(this.protectionElementAttribute.trim().equalsIgnoreCase("")))
		protectionElement.setAttribute(this.protectionElementAttribute);
	if (this.protectionElementValue != null && !(this.protectionElementValue.trim().equalsIgnoreCase("")))
		protectionElement.setValue(this.protectionElementValue);
	
	SearchCriteria searchCriteria = new ProtectionElementSearchCriteria(protectionElement);
	List list = userProvisioningManager.getObjects(searchCriteria);
	SearchResult searchResult = new SearchResult();
	searchResult.setSearchResultMessage(searchCriteria.getMessage());
	searchResult.setSearchResultObjects(list);
	return searchResult;
}
 
开发者ID:NCIP,项目名称:common-security-module,代码行数:23,代码来源:ProtectionElementForm.java

示例9: searchObjects

import gov.nih.nci.security.authorization.domainobjects.ProtectionElement; //导入方法依赖的package包/类
public SearchResult searchObjects(UserProvisioningManager userProvisioningManager) throws Exception 
{
	ProtectionElement protectionElement = new ProtectionElement();
	
	if (this.protectionElementName != null && !(this.protectionElementName.trim().equalsIgnoreCase("")))
		protectionElement.setProtectionElementName(this.protectionElementName);
	if (this.protectionElementType != null && !(this.protectionElementType.trim().equalsIgnoreCase("")))
		protectionElement.setProtectionElementType(this.protectionElementType);
	if (this.protectionElementObjectId != null && !(this.protectionElementObjectId.trim().equalsIgnoreCase("")))
		protectionElement.setObjectId(this.protectionElementObjectId);
	if (this.protectionElementAttribute != null && !(this.protectionElementAttribute.trim().equalsIgnoreCase("")))
		protectionElement.setAttribute(this.protectionElementAttribute);
	
	SearchCriteria searchCriteria = new ProtectionElementSearchCriteria(protectionElement);
	List list = userProvisioningManager.getObjects(searchCriteria);
	SearchResult searchResult = new SearchResult();
	searchResult.setSearchResultMessage(searchCriteria.getMessage());
	searchResult.setSearchResultObjects(list);
	return searchResult;
}
 
开发者ID:NCIP,项目名称:common-security-module,代码行数:21,代码来源:SearchProtectionElementForm.java

示例10: createProtectionGroup

import gov.nih.nci.security.authorization.domainobjects.ProtectionElement; //导入方法依赖的package包/类
@SuppressWarnings("PMD.ExcessiveMethodLength")
private static ProtectionGroup createProtectionGroup(Protectable p, User csmUser) throws CSObjectNotFoundException,
        CSTransactionException {

    final ProtectionElement pe = new ProtectionElement();
    final Application application = getApplication();
    pe.setApplication(application);
    pe.setObjectId(p.getClass().getName());
    pe.setAttribute("id");
    pe.setValue(p.getId().toString());
    pe.setUpdateDate(new Date());
    authMgr.createProtectionElement(pe);

    final ProtectionGroup pg = new ProtectionGroup();
    pg.setApplication(application);
    pg.setProtectionElements(Collections.singleton(pe));
    pg.setProtectionGroupName("PE(" + pe.getProtectionElementId() + ") group");
    pg.setUpdateDate(new Date());
    authMgr.createProtectionGroup(pg);

    addOwner(pg, csmUser);
    assignSystemAdministratorAccess(pg);
    return pg;
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:25,代码来源:SecurityUtils.java

示例11: getPrivilegeMap2

import gov.nih.nci.security.authorization.domainobjects.ProtectionElement; //导入方法依赖的package包/类
public void getPrivilegeMap2(){
	// both object id and attribute
	try{
		AuthorizationManager am = (AuthorizationManager)upm;
		ArrayList al = new ArrayList();
		ProtectionElement pe1 = new ProtectionElement();
		pe1.setObjectId("TestElement2");
		pe1.setAttribute("TestElement2");
		al.add(pe1);
		Collection map = am.getPrivilegeMap("testcaseuser2",al);
		Iterator it = map.iterator();
		while (it.hasNext())
		{
			ObjectPrivilegeMap opm = (ObjectPrivilegeMap)it.next();
			ProtectionElement pe = opm.getProtectionElement();
			System.out.println("The Protection Element is : " + pe.getObjectId()+" : " + pe.getAttribute());
			Collection privList = opm.getPrivileges();
			Iterator it2 = privList.iterator();
			while (it2.hasNext())
			{
				Privilege priv = (Privilege)it2.next();
				System.out.println("The Privilege is : " + priv.getName());
			}
		}
	}catch(Exception ex){
		ex.printStackTrace();
	}
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:29,代码来源:TestClient.java

示例12: createProtectionElementInstance

import gov.nih.nci.security.authorization.domainobjects.ProtectionElement; //导入方法依赖的package包/类
private ProtectionElement createProtectionElementInstance(StudyConfiguration studyConfiguration) {
    ProtectionElement element = new ProtectionElement();
    element.setAttribute(STUDY_ATTRIBUTE);
    element.setObjectId(STUDY_OBJECT);
    element.setValue(String.valueOf(studyConfiguration.getStudy().getId()));
    return element;
}
 
开发者ID:NCIP,项目名称:caintegrator,代码行数:8,代码来源:SecurityManagerImpl.java


注:本文中的gov.nih.nci.security.authorization.domainobjects.ProtectionElement.setAttribute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。