本文整理汇总了Java中gov.nih.nci.security.exceptions.CSException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java CSException.printStackTrace方法的具体用法?Java CSException.printStackTrace怎么用?Java CSException.printStackTrace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gov.nih.nci.security.exceptions.CSException
的用法示例。
在下文中一共展示了CSException.printStackTrace方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testCheckPermissionStringStringString3
import gov.nih.nci.security.exceptions.CSException; //导入方法依赖的package包/类
public void testCheckPermissionStringStringString3() throws InterruptedException, CSException
{
//Checks how CheckPermission() handles a user that is not in session
boolean hasPermission = false;
try
{
hasPermission = authorizationManagerUser.checkPermission("asdf", "AuthPolicyTest2", "AuthPolicyTest2", "UPDATE");
} catch (CSException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
assertEquals(true,hasPermission);
//Test code!!! Comment this code out as needed
//Thread.sleep(30000); //Change or remove permissions in the database during this time
hasPermission = authorizationManagerUser.checkPermission("asdf", "AuthPolicyTest2", "AuthPolicyTest2", "UPDATE");
assertEquals(false,hasPermission);
}
示例2: main
import gov.nih.nci.security.exceptions.CSException; //导入方法依赖的package包/类
public static void main(String[] args)
{
try
{
Properties p = System.getProperties();
p.setProperty("gov.nih.nci.security.configFile","C:/securityConfig/ApplicationSecurityConfig.xml");
UserProvisioningManager upm = SecurityServiceProvider.getUserProvisioningManager("security");
Set privileges = new HashSet();
Role r = new Role();
r.setName("MockTestknm");
r.setDesc("MockTestknm");
Byte b = new Byte("1");
r.setActive_flag(b.byteValue());
upm.createRole(r);
Privilege p1 = new Privilege();
p1.setName("MockTestknm1");
p1.setDesc("MockTestknm1");
upm.createPrivilege(p1);
privileges.add(p1);
Privilege p2 = new Privilege();
p2.setName("MockTestknm2");
p2.setDesc("MockTestknm2");
upm.createPrivilege(p2);
privileges.add(p2);
addChildren(r, privileges, "privileges");
upm.modifyRole(r);
} catch (CSException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
示例3: setAssociation
import gov.nih.nci.security.exceptions.CSException; //导入方法依赖的package包/类
public String setAssociation(String[] associatedIds) throws Exception
{
HttpServletRequest request = ServletActionContext.getRequest();
HttpSession session = request.getSession();
if (session.isNew() || (session.getAttribute(DisplayConstants.LOGIN_OBJECT) == null)) {
if (logAssociation.isDebugEnabled())
logAssociation.debug("||"+applicationForm.getFormName()+"|setAssociation|Failure|No Session or User Object Forwarding to the Login Page||");
return ForwardConstants.LOGIN_PAGE;
}
try
{
session.setAttribute(DisplayConstants.CREATE_WORKFLOW, "0");
UserProvisioningManager userProvisioningManager = (UserProvisioningManager)(request.getSession()).getAttribute(DisplayConstants.USER_PROVISIONING_MANAGER);
applicationForm.setRequest(request);
applicationForm.buildDisplayForm(userProvisioningManager);
applicationForm.setAssociatedIds(associatedIds);
applicationForm.setAssociationObject(userProvisioningManager);
addActionMessage("Association Update Successful");
}
catch (CSException cse)
{
cse.printStackTrace();
addActionError(org.apache.commons.lang.StringEscapeUtils.escapeHtml(cse.getMessage()));
if (logAssociation.isDebugEnabled())
logAssociation.debug(session.getId()+"|"+((LoginForm)session.getAttribute(DisplayConstants.LOGIN_OBJECT)).getLoginId()+
"|"+applicationForm.getFormName()+"|setAssociation|Failure|Error in setting Association for the "+applicationForm.getFormName()+" object|"
+"|"+ cse.getMessage());
}
session.setAttribute(DisplayConstants.CURRENT_ACTION, DisplayConstants.SEARCH);
session.setAttribute(DisplayConstants.CURRENT_FORM, applicationForm);
if (logAssociation.isDebugEnabled())
logAssociation.debug(session.getId()+"|"+((LoginForm)session.getAttribute(DisplayConstants.LOGIN_OBJECT)).getLoginId()+
"|"+applicationForm.getFormName()+"|setAssociation|Success|Success in setting association for "+applicationForm.getFormName()+" object|");
return ForwardConstants.SET_ASSOCIATION_SUCCESS;
}
示例4: testCheckPermissionStringStringStringString1
import gov.nih.nci.security.exceptions.CSException; //导入方法依赖的package包/类
public void testCheckPermissionStringStringStringString1()
{
try
{
boolean hasPermission = authorizationManagerUser.checkPermission("modik", "AuthPolicyTest2", "AuthPolicyTest2", "UPDATE");
assertEquals(true,hasPermission);
}
catch (CSException e)
{
e.printStackTrace();
}
}
示例5: testCheckPermissionStringStringStringString2
import gov.nih.nci.security.exceptions.CSException; //导入方法依赖的package包/类
public void testCheckPermissionStringStringStringString2()
{
try
{
boolean hasPermission = authorizationManagerUser.checkPermission("modik", "AuthPolicyTest2", "AuthPolicyTest2", "READ");
assertEquals(false,hasPermission);
}
catch (CSException e)
{
e.printStackTrace();
}
}
示例6: testCheckPermissionStringStringStringString3
import gov.nih.nci.security.exceptions.CSException; //导入方法依赖的package包/类
public void testCheckPermissionStringStringStringString3()
{
try
{
boolean hasPermission = authorizationManagerUser.checkPermission("modik", "AuthPolicyTest2", "", "READ");
assertEquals(false,hasPermission);
}
catch (CSException e)
{
e.printStackTrace();
}
}
示例7: testCheckPermissionStringStringString1
import gov.nih.nci.security.exceptions.CSException; //导入方法依赖的package包/类
public void testCheckPermissionStringStringString1()
{
try
{
boolean hasPermission = authorizationManagerUser.checkPermission("modik", "AuthPolicyTest1", "ACCESS");
assertEquals(true,hasPermission);
}
catch (CSException e)
{
e.printStackTrace();
}
}
示例8: testCheckPermissionForGroupStringStringString2
import gov.nih.nci.security.exceptions.CSException; //导入方法依赖的package包/类
public void testCheckPermissionForGroupStringStringString2()
{
try
{
boolean hasPermission = authorizationManagerGroup.checkPermissionForGroup("AuthPolicyTest", "AuthPolicyTest1", "READ");
assertEquals(false,hasPermission);
}
catch (CSException e)
{
e.printStackTrace();
}
}
示例9: testCheckPermissionForGroupStringStringStringString2
import gov.nih.nci.security.exceptions.CSException; //导入方法依赖的package包/类
public void testCheckPermissionForGroupStringStringStringString2()
{
try
{
boolean hasPermission = authorizationManagerGroup.checkPermissionForGroup("AuthPolicyTest", "AuthPolicyTest2", "AuthPolicyTest2", "READ");
assertEquals(false,hasPermission);
}
catch (CSException e)
{
e.printStackTrace();
}
}
示例10: testCheckPermissionForGroupStringStringString1
import gov.nih.nci.security.exceptions.CSException; //导入方法依赖的package包/类
public void testCheckPermissionForGroupStringStringString1()
{
try
{
boolean hasPermission = authorizationManagerGroup.checkPermissionForGroup("AuthPolicyTest", "AuthPolicyTest1", "ACCESS");
assertEquals(true,hasPermission);
}
catch (CSException e)
{
e.printStackTrace();
}
}
示例11: constructResponse
import gov.nih.nci.security.exceptions.CSException; //导入方法依赖的package包/类
/**
* This method get a list of protection groups with associated protection elements
*
* @return String - list of protection groups with associated protection elements
*/
@GET
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.TEXT_HTML, TEXT_CSV})
public Response constructResponse(@QueryParam("format") String format) {
List<Object []> result = new ArrayList<Object[]>();
try {
UserProvisioningManager upm = getUpm();
List<ProtectionGroup> pgs = upm.getProtectionGroups();
for (ProtectionGroup pg : pgs) {
List<ProtectionElement> pes = new ArrayList<ProtectionElement>(upm.getProtectionElements(pg.getProtectionGroupId().toString()));
StringBuffer allPeNames = new StringBuffer();
boolean first = true;
for (ProtectionElement pe : pes) {
if (first) {
allPeNames.append(pe.getProtectionElementName());
first = false;
}
else allPeNames.append(", "+pe.getProtectionElementName());
}
Object [] objs = {pg.getProtectionGroupName(), pg.getProtectionGroupDescription(), allPeNames.toString()};
result.add(objs);
}
} catch (CSException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return formatResponse(format, result, columns);
}
示例12: main
import gov.nih.nci.security.exceptions.CSException; //导入方法依赖的package包/类
public static void main(String[] args)
{
try
{
Properties p = System.getProperties();
p.setProperty("gov.nih.nci.security.configFile","ApplicationSecurityConfig.xml");
UserProvisioningManager upm = SecurityServiceProvider.getUserProvisioningManager("security");
Set privileges = new HashSet();
Role r = new Role();
r.setName("MockTestknm");
r.setDesc("MockTestknm");
Byte b = new Byte("1");
r.setActive_flag(b.byteValue());
upm.createRole(r);
Privilege p1 = new Privilege();
p1.setName("MockTestknm1");
p1.setDesc("MockTestknm1");
upm.createPrivilege(p1);
privileges.add(p1);
Privilege p2 = new Privilege();
p2.setName("MockTestknm2");
p2.setDesc("MockTestknm2");
upm.createPrivilege(p2);
privileges.add(p2);
addChildren(r, privileges, "privileges");
upm.modifyRole(r);
} catch (CSException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
示例13: getAuthenticationManager
import gov.nih.nci.security.exceptions.CSException; //导入方法依赖的package包/类
private AuthenticationManager getAuthenticationManager(){
if (null == authenticationManager)
try {
authenticationManager = SecurityServiceProvider.getAuthenticationManager(applicationContextName);
} catch (CSException e) {
e.printStackTrace();
}
return authenticationManager;
}
示例14: testCheckPermissionForGroupStringStringStringString1
import gov.nih.nci.security.exceptions.CSException; //导入方法依赖的package包/类
public void testCheckPermissionForGroupStringStringStringString1()
{
try
{
boolean hasPermission = authorizationManagerGroup.checkPermissionForGroup("AuthPolicyTest", "AuthPolicyTest2", "AuthPolicyTest2", "UPDATE");
assertEquals(true,hasPermission);
}
catch (CSException e)
{
e.printStackTrace();
}
}