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


Java CSException.getMessage方法代码示例

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


在下文中一共展示了CSException.getMessage方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: login

import gov.nih.nci.security.exceptions.CSException; //导入方法依赖的package包/类
/**
 * Returns true or false depending on the person gets authenticated or not.
 * @param requestingClass
 * @param loginName login name
 * @param password password
 * @return @throws CSException
 */
public boolean login(String loginName, String password) throws SMException 
{
	boolean loginSuccess = false;
	try 
	{
		Logger.out.debug("login name: " + loginName + " passowrd: " + password);
		AuthenticationManager authMngr = getAuthenticationManager();
		loginSuccess = authMngr.login(loginName, password);
	} 
	catch (CSException ex) 
	{
		Logger.out.debug("Authentication|"
						+ requestingClass
						+ "|"
						+ loginName
						+ "|login|Success| Authentication is not successful for user "
						+ loginName + "|" + ex.getMessage());
		throw new SMException(ex.getMessage(), ex);
	}
	return loginSuccess;
}
 
开发者ID:NCIP,项目名称:wustl-common-package,代码行数:29,代码来源:SecurityManager.java

示例2: getRoles

import gov.nih.nci.security.exceptions.CSException; //导入方法依赖的package包/类
/**
 * This method returns Vactor of all the role objects defined for the
 * application from the database
 * 
 * @return @throws
 *         SMException
 */
public Vector getRoles() throws SMException {
	Vector roles = new Vector();
	UserProvisioningManager userProvisioningManager = null;
	try {
		userProvisioningManager = getUserProvisioningManager();
		roles.add(userProvisioningManager.getRoleById(ADMINISTRATOR_ROLE));
		roles.add(userProvisioningManager.getRoleById(SUPERVISOR_ROLE));
		roles.add(userProvisioningManager.getRoleById(TECHNICIAN_ROLE));
		roles.add(userProvisioningManager.getRoleById(PUBLIC_ROLE));
	} catch (CSException e) {
		Logger.out.debug("Unable to get roles: Exception: "
				+ e.getMessage());
		throw new SMException(e.getMessage(), e);
	}
	return roles;
}
 
开发者ID:NCIP,项目名称:wustl-common-package,代码行数:24,代码来源:SecurityManager.java

示例3: getUser

import gov.nih.nci.security.exceptions.CSException; //导入方法依赖的package包/类
/**
 * This method returns the User object from the database for the passed
 * User's Login Name. If no User is found then null is returned
 * 
 * @param loginName
 *            Login name of the user
 * @return @throws
 *         SMException
 */
public User getUser(String loginName) throws SMException {
	try {
		return getAuthorizationManager().getUser(loginName);
	} catch (CSException e) {
		Logger.out
				.debug("Unable to get user: Exception: " + e.getMessage());
		throw new SMException(e.getMessage(), e);
	}
}
 
开发者ID:NCIP,项目名称:wustl-common-package,代码行数:19,代码来源:SecurityManager.java

示例4: assignRoleToUser

import gov.nih.nci.security.exceptions.CSException; //导入方法依赖的package包/类
/**
 * Assigns a Role to a User
 * 
 * @param userName -
 *            the User Name to to whom the Role will be assigned
 * @param roleID -
 *            The id of the Role which is to be assigned to the user
 * @throws SMException
 */
public void assignRoleToUser(String userID, String roleID)
		throws SMException {
	Logger.out.debug("UserName: " + userID + " Role ID:" + roleID);
	UserProvisioningManager userProvisioningManager = null;
	User user;
	String groupId;
	try {
		userProvisioningManager = getUserProvisioningManager();
		//user = userProvisioningManager.getUser(userName);
		user = userProvisioningManager.getUserById(userID);

		//Remove user from any other role if he is assigned some
		userProvisioningManager.removeUserFromGroup(ADMINISTRATOR_ROLE,
				String.valueOf(user.getUserId()));
		userProvisioningManager.removeUserFromGroup(SUPERVISOR_ROLE, String
				.valueOf(user.getUserId()));
		userProvisioningManager.removeUserFromGroup(TECHNICIAN_ROLE, String
				.valueOf(user.getUserId()));
		userProvisioningManager.removeUserFromGroup(PUBLIC_GROUP_ID, String
				.valueOf(user.getUserId()));

		//Add user to corresponding group
		groupId = getGroupIdForRole(roleID);
		if (groupId == null) {
			Logger.out.debug(" User assigned no role");
		} else {
			assignAdditionalGroupsToUser(String.valueOf(user.getUserId()),
					new String[] { groupId });
			Logger.out.debug(" User assigned role:" + groupId);
		}

	} catch (CSException e) {
		Logger.out.debug("UNABLE TO ASSIGN ROLE TO USER: Exception: "
				+ e.getMessage());
		throw new SMException(e.getMessage(), e);
	}
}
 
开发者ID:NCIP,项目名称:wustl-common-package,代码行数:47,代码来源:SecurityManager.java

示例5: getUserById

import gov.nih.nci.security.exceptions.CSException; //导入方法依赖的package包/类
/**
 * Returns the User object for the passed User id
 * 
 * @param userId -
 *            The id of the User object which is to be obtained
 * @return The User object from the database for the passed User id
 * @throws SMException
 *             if the User object is not found for the given id
 */
public User getUserById(String userId) throws SMException {
	Logger.out.debug("user Id: " + userId);
	try {
		User user = getUserProvisioningManager().getUserById(userId);
		Logger.out.debug("User returned: " + user.getLoginName());
		return user;
	} catch (CSException e) {
		Logger.out.debug("Unable to get user by Id: Exception: "
				+ e.getMessage());
		throw new SMException(e.getMessage(), e);
	}
}
 
开发者ID:NCIP,项目名称:wustl-common-package,代码行数:22,代码来源:SecurityManager.java

示例6: getUsersByEmail

import gov.nih.nci.security.exceptions.CSException; //导入方法依赖的package包/类
/**
 * Returns list of the User objects for the passed email address
 * 
 * @param emailAddress -
 *            Email Address for which users need to be searched
 * @return @throws
 *         SMException if there is any exception while querying the database
 */
public List getUsersByEmail(String emailAddress) throws SMException {
	try {
		User user = new User();
		user.setEmailId(emailAddress);
		SearchCriteria searchCriteria = new UserSearchCriteria(user);
		return getUserProvisioningManager().getObjects(searchCriteria);
	} catch (CSException e) {
		Logger.out.debug("Unable to get users by emailAddress: Exception: "
				+ e.getMessage());
		throw new SMException(e.getMessage(), e);
	}
}
 
开发者ID:NCIP,项目名称:wustl-common-package,代码行数:21,代码来源:SecurityManager.java

示例7: getUsers

import gov.nih.nci.security.exceptions.CSException; //导入方法依赖的package包/类
/**
 * @throws SMException
 *  
 */
public List getUsers() throws SMException {
	try {
		User user = new User();
		SearchCriteria searchCriteria = new UserSearchCriteria(user);
		return getUserProvisioningManager().getObjects(searchCriteria);
	} catch (CSException e) {
		Logger.out.debug("Unable to get all users: Exception: "
				+ e.getMessage());
		throw new SMException(e.getMessage(), e);
	}
}
 
开发者ID:NCIP,项目名称:wustl-common-package,代码行数:16,代码来源:SecurityManager.java

示例8: isAuthorized

import gov.nih.nci.security.exceptions.CSException; //导入方法依赖的package包/类
public boolean isAuthorized(String userName, String objectId,
		String attributeName, String privilegeName) throws SMException {
	try {
		return getAuthorizationManager().checkPermission(userName,
				objectId, attributeName, privilegeName);
	} catch (CSException e) {
		Logger.out.debug("Unable to get all users: Exception: "
				+ e.getMessage());
		throw new SMException(e.getMessage(), e);
	}
}
 
开发者ID:NCIP,项目名称:wustl-common-package,代码行数:12,代码来源:SecurityManager.java

示例9: checkPermission

import gov.nih.nci.security.exceptions.CSException; //导入方法依赖的package包/类
/**
 * Checks whether the user group of id (groupid) has permission 
 * over the object of type (objectType) with the given identifier (objectIdentifier).
 * @param groupId The user group to be checked.
 * @param objectType The object type.
 * @param objectIdentifier The iedntifier of the object.
 * @return Returns true if the user group has permission over the object, else returns false.
 * @throws SMException
 */
public boolean checkPermission(String groupId, String objectType,
		String objectIdentifier) throws SMException 
{
    Logger.out.debug("Check Privilege for user group.................................");
    String protectionElementName = objectType + "_" + objectIdentifier; 
    Logger.out.debug("protectionElementName>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"+protectionElementName);
    
    try
    {
        UserProvisioningManager userProvisioningManager = getUserProvisioningManager();  
	    Set privilegeContextForGroup = userProvisioningManager
	    								.getProtectionElementPrivilegeContextForGroup(groupId);
	    Iterator iterator = privilegeContextForGroup.iterator();
	    while (iterator.hasNext())
	    {
	        ProtectionElementPrivilegeContext pePrivilegeContext = (ProtectionElementPrivilegeContext) iterator.next();
	        if (pePrivilegeContext.getProtectionElement().getProtectionElementName().equals(protectionElementName))
	        {
	            return true;
	        }
	    }
    }
    catch (CSObjectNotFoundException csObjNotExp)
    {
        throw new SMException(csObjNotExp.getMessage(), csObjNotExp);
    }
    catch (CSException csExp)
    {
        throw new SMException(csExp.getMessage(), csExp);
    }
    
    return false;
}
 
开发者ID:NCIP,项目名称:wustl-common-package,代码行数:43,代码来源:SecurityManager.java

示例10: authorizeOperation

import gov.nih.nci.security.exceptions.CSException; //导入方法依赖的package包/类
public void authorizeOperation(Subject subject, MessageContext context, QName qname) throws AuthorizationException {
    String methodName = qname.getLocalPart();
    boolean authorized = false;
    if (authorizationDescription.getCSMMethodAuthorization() != null) {
        for (int i = 0; i < authorizationDescription.getCSMMethodAuthorization().length; i++) {
            if (authorizationDescription.getCSMMethodAuthorization(i).getMethodName().equals(methodName)) {
                CSMAuthorizationDescription desc = authorizationDescription.getCSMMethodAuthorization(i)
                    .getCSMAuthorizationDescription();
                try {

                    String object = "";
                    if (desc.getProtectionMethod().equals(ProtectionMethod.ServiceURI)) {
                        org.apache.axis.message.addressing.EndpointReferenceType type = org.globus.wsrf.utils.AddressingUtils
                            .createEndpointReference(null);
                        object = type.getAddress().toString() + ":" + methodName;
                    } else if (desc.getPrivilege().equals(ProtectionMethod.ServiceType)) {
                        object = authorizationDescription.getServiceName() + ":" + methodName;
                    } else {
                        object = desc.getCustomProtectionMethod();
                    }

                    try {
                        AuthorizationManager authManager = SecurityServiceProvider
                            .getUserProvisioningManager(desc.getApplicationContext());
                        authorized = authManager.checkPermission(getCallerIdentity(), object, desc
                            .getPrivilege());

                        if (!authorized) {
                            throw new AuthorizationException("User " + getCallerIdentity() + " not authorized for "
                                + desc.getPrivilege() + " on " + object);
                        }
                    } catch (CSException cse) {
                        cse.printStackTrace();
                        throw new InitializeException(cse.getMessage(), cse);
                    }

                } catch (Exception e) {
                    e.printStackTrace();
                    throw new AuthorizationException(e.getMessage(), e);
                }
            }
        }
    }

    if (!authorized) {
        throw new AuthorizationException("User not authorizied.");
    }

}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:50,代码来源:CSMAuthorization.java

示例11: authorizeService

import gov.nih.nci.security.exceptions.CSException; //导入方法依赖的package包/类
public void authorizeService(Subject subject, MessageContext context, QName operation)
    throws AuthorizationException {
    if (authorizationDescription.getCSMAuthorizationDescription() != null) {
        boolean authorized = false;
        try {

            String object = "";
            if (authorizationDescription.getCSMAuthorizationDescription().getProtectionMethod().equals(
                ProtectionMethod.ServiceURI)) {
                org.apache.axis.message.addressing.EndpointReferenceType type = org.globus.wsrf.utils.AddressingUtils
                    .createEndpointReference(null);
                object = type.getAddress().toString();
            } else if (authorizationDescription.getCSMAuthorizationDescription().getPrivilege().equals(
                ProtectionMethod.ServiceType)) {
                object = authorizationDescription.getServiceName();
            } else {
                object = authorizationDescription.getCSMAuthorizationDescription().getCustomProtectionMethod();
            }

            try {
                AuthorizationManager authManager = SecurityServiceProvider
                    .getUserProvisioningManager(authorizationDescription.getCSMAuthorizationDescription()
                        .getApplicationContext());

                authorized = authManager.checkPermission(getCallerIdentity(), object,
                    authorizationDescription.getCSMAuthorizationDescription().getPrivilege());

                if (!authorized) {
                    throw new AuthorizationException("User " + getCallerIdentity() + " not authorized for "
                        + this.authorizationDescription.getCSMAuthorizationDescription().getPrivilege() + " on "
                        + object);
                }

            } catch (CSException cse) {
                cse.printStackTrace();
                throw new InitializeException(cse.getMessage(), cse);
            }

        } catch (Exception e) {
            e.printStackTrace();
            throw new AuthorizationException(e.getMessage(), e);
        }
        if (!authorized) {
            throw new AuthorizationException("User not authorizied.");
        }
    }
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:48,代码来源:CSMAuthorization.java

示例12: modifyUser

import gov.nih.nci.security.exceptions.CSException; //导入方法依赖的package包/类
/**
 * Modifies an entry for an existing User in the database based on the data
 * passed
 * 
 * @param user -
 *            the User object that needs to be modified in the database
 * @throws SMException
 *             if there is any exception in modifying the User in the
 *             database
 */
public void modifyUser(User user) throws SMException {
	try {
		getUserProvisioningManager().modifyUser(user);
	} catch (CSException e) {
		Logger.out.debug("Unable to modify user: Exception: "
				+ e.getMessage());
		throw new SMException(e.getMessage(), e);
	}
}
 
开发者ID:NCIP,项目名称:wustl-common-package,代码行数:20,代码来源:SecurityManager.java


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