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


Java ProtectionElement类代码示例

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


ProtectionElement类属于gov.nih.nci.security.authorization.domainobjects包,在下文中一共展示了ProtectionElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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

示例2: assignProtectionElementToGroup

import gov.nih.nci.security.authorization.domainobjects.ProtectionElement; //导入依赖的package包/类
/**
 * @param protectionElement
 * @param userProvisioningManager
 * @param dynamicGroups
 * @param i
 * @throws CSException
 */
private void assignProtectionElementToGroup(
		ProtectionElement protectionElement, String GroupsName)

{
	try {
		UserProvisioningManager userProvisioningManager = getUserProvisioningManager();
		userProvisioningManager.assignProtectionElement(GroupsName,
				protectionElement.getObjectId());
		Logger.out.debug("Associated protection group: " + GroupsName
				+ " to protectionElement"
				+ protectionElement.getProtectionElementName());
	}

	catch (CSException e) {
		Logger.out
				.error(
						"The Security Service encountered an error while associating protection group: "
								+ GroupsName
								+ " to protectionElement"
								+ protectionElement
										.getProtectionElementName());
	}
}
 
开发者ID:NCIP,项目名称:wustl-common-package,代码行数:31,代码来源:SecurityManager.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,代码来源:UserProvisioningManagerTest.java

示例4: 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

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

示例6: retrieveAuthorizedStudyElementsGroupIds

import gov.nih.nci.security.authorization.domainobjects.ProtectionElement; //导入依赖的package包/类
@SuppressWarnings(UNCHECKED) // CSM API is untyped
private Set<Long> retrieveAuthorizedStudyElementsGroupIds(Set<ProtectionGroup> protectionGroups)
                                                                                throws CSException {
    Set<Long> authorizedStudyElementsGroupIds = new HashSet<Long>();
    for (ProtectionGroup group : protectionGroups) {
        Set<ProtectionElement> elements =
            getAuthorizationManager().getProtectionElements(String.valueOf(group.getProtectionGroupId()));
        for (ProtectionElement element : elements) {
            if (AUTHORIZED_STUDY_ELEMENTS_GROUP_OBJECT.equals(element.getObjectId())
                                                        && NumberUtils.isNumber(element.getValue())) {
                authorizedStudyElementsGroupIds.add(Long.valueOf(element.getValue()));
            }
        }
    }
    return authorizedStudyElementsGroupIds;
}
 
开发者ID:NCIP,项目名称:caintegrator,代码行数:17,代码来源:SecurityManagerImpl.java

示例7: 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

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

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

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

示例11: getProjectsForOwner

import gov.nih.nci.security.authorization.domainobjects.ProtectionElement; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public List<Project> getProjectsForOwner(User user) {
    final String q =
            "SELECT DISTINCT p FROM " + Project.class.getName() + " p left join fetch p.experiment e where p.id in"
                    + "(select pe.value from " + ProtectionElement.class.getName()
                    + " pe where pe.objectId = :objectId and pe.attribute = :attribute and "
                    + " pe.application = :application and :user in elements(pe.owners)) ";

    final Query query = getCurrentSession().createQuery(q);
    query.setString("objectId", Project.class.getName());
    query.setString("attribute", "id");
    query.setEntity("application", SecurityUtils.getApplication());
    query.setEntity("user", user);

    @SuppressWarnings("unchecked")
    final List<Project> projects = query.list();
    return projects; // NOPMD
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:22,代码来源:ProjectDaoImpl.java

示例12: testProtectionGroupModify

import gov.nih.nci.security.authorization.domainobjects.ProtectionElement; //导入依赖的package包/类
/**
public void testProtectionGroupModify(){
	UserProvisioningManager upm = SecurityServiceProvider.getUserProvisioningManger("Security");

	try{
		ProtectionGroup pg = upm.getProtectionGroup(new Long("2"));
		ProtectionGroup pg1 = upm.getProtectionGroup(new Long("50"));
		pg1.setParentProtectionGroup(pg);
		upm.modifyProtectionGroup(pg1);


	}catch(Exception ex){
		ex.printStackTrace();
	}
}
*/
public void testProtectionElementCreate(){
	//UserProvisioningManager upm = SecurityServiceProvider.getUserProvisioningManger("Security");

	try{
		/**
		for(int i=1;i<100000;i++){
			ProtectionElement pe = new ProtectionElement();
			pe.setProtectionElementName("PE_Name_"+i);
			pe.setObjectId("X_Y_Z_"+i);
			pe.setProtectionElementDescription("PE_Desc"+i);

			upm.createProtectionElement(pe);
			System.out.println("The returned id is"+pe.getProtectionElementId());
		}
		*/
		ProtectionElement pe = new ProtectionElement();
		pe.setProtectionElementId(new Long(20));
		upm.createProtectionElement(pe);

	}catch(Exception ex){
		ex.printStackTrace();
		System.out.println("Error:"+ex.getMessage());
	}
}
 
开发者ID:NCIP,项目名称:common-security-module,代码行数:41,代码来源:TestClient.java

示例13: 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

示例14: getSecurityMapForPublicRole

import gov.nih.nci.security.authorization.domainobjects.ProtectionElement; //导入依赖的package包/类
public Set<TableProtectionElement> getSecurityMapForPublicRole()
    throws CSObjectNotFoundException {

    Set<ProtectionElement> pes = upm.getProtectionElements(publicProtGroupId.toString());
    Set<TableProtectionElement> retSet = new HashSet<TableProtectionElement>();
    Map<String, TableProtectionElement> tempHastable = new Hashtable<String, TableProtectionElement>();

    for (ProtectionElement pElement : pes) {
        TableProtectionElement el = new TableProtectionElement(pElement);
        el.addRole(readRoleName);
        tempHastable.put(pElement.getProtectionElementName(), el);
    }

    retSet.addAll(tempHastable.values());

    return retSet;
}
 
开发者ID:NCIP,项目名称:national-biomedical-image-archive,代码行数:18,代码来源:NCIASecurityManagerImpl.java

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


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