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


Java Session.copy方法代码示例

本文整理汇总了Java中org.apache.directory.fortress.core.model.Session.copy方法的典型用法代码示例。如果您正苦于以下问题:Java Session.copy方法的具体用法?Java Session.copy怎么用?Java Session.copy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.directory.fortress.core.model.Session的用法示例。


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

示例1: addActiveRole

import org.apache.directory.fortress.core.model.Session; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void addActiveRole(Session session, UserAdminRole role)
    throws SecurityException
{
    String methodName = CLS_NM + ".addActiveRole";
    VUtil.assertNotNull(session, GlobalErrIds.USER_SESS_NULL, methodName);
    VUtil.assertNotNull(role, GlobalErrIds.ARLE_NULL, methodName);
    FortRequest request = new FortRequest();
    request.setContextId(this.contextId);
    request.setSession(session);
    request.setEntity(role);
    String szRequest = RestUtils.marshal(request);
    String szResponse = RestUtils.getInstance().post(szRequest, HttpIds.ADMIN_ADD);
    FortResponse response = RestUtils.unmarshall(szResponse);
    if (response.getErrorCode() == 0)
    {
        Session outSession = response.getSession();
        session.copy(outSession);
    }
    else
    {
        throw new SecurityException(response.getErrorCode(), response.getErrorMessage());
    }
}
 
开发者ID:apache,项目名称:directory-fortress-core,代码行数:28,代码来源:DelAccessMgrRestImpl.java

示例2: dropActiveRole

import org.apache.directory.fortress.core.model.Session; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void dropActiveRole(Session session, UserAdminRole role)
    throws SecurityException
{
    String methodName = CLS_NM + ".dropActiveRole";
    VUtil.assertNotNull(session, GlobalErrIds.USER_SESS_NULL, methodName);
    VUtil.assertNotNull(role, GlobalErrIds.ARLE_NULL, methodName);
    FortRequest request = new FortRequest();
    request.setContextId(this.contextId);
    request.setSession(session);
    request.setEntity(role);
    String szRequest = RestUtils.marshal(request);
    String szResponse = RestUtils.getInstance().post(szRequest, HttpIds.ADMIN_DROP);
    FortResponse response = RestUtils.unmarshall(szResponse);
    if (response.getErrorCode() == 0)
    {
        Session outSession = response.getSession();
        session.copy(outSession);
    }
    else
    {
        throw new SecurityException(response.getErrorCode(), response.getErrorMessage());
    }
}
 
开发者ID:apache,项目名称:directory-fortress-core,代码行数:28,代码来源:DelAccessMgrRestImpl.java

示例3: sessionAdminRoles

import org.apache.directory.fortress.core.model.Session; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public List<UserAdminRole> sessionAdminRoles(Session session)
    throws SecurityException
{
    VUtil.assertNotNull(session, GlobalErrIds.USER_SESS_NULL, CLS_NM + ".sessionAdminRoles");
    List<UserAdminRole> roles;
    FortRequest request = new FortRequest();
    request.setContextId(this.contextId);
    request.setSession(session);
    String szRequest = RestUtils.marshal(request);
    String szResponse = RestUtils.getInstance().post(szRequest, HttpIds.ADMIN_ROLES);
    FortResponse response = RestUtils.unmarshall(szResponse);
    if (response.getErrorCode() == 0)
    {
        roles = response.getEntities();
        Session outSession = response.getSession();
        session.copy(outSession);
    }
    else
    {
        throw new SecurityException(response.getErrorCode(), response.getErrorMessage());
    }
    return roles;
}
 
开发者ID:apache,项目名称:directory-fortress-core,代码行数:28,代码来源:DelAccessMgrRestImpl.java

示例4: sessionPermissions

import org.apache.directory.fortress.core.model.Session; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public List<Permission> sessionPermissions(Session session)
    throws SecurityException
{
    VUtil.assertNotNull(session, GlobalErrIds.USER_SESS_NULL, CLS_NM + ".sessionPermissions");
    List<Permission> retPerms;
    FortRequest request = new FortRequest();
    request.setContextId(this.contextId);
    request.setSession(session);
    String szRequest = RestUtils.marshal(request);
    String szResponse = RestUtils.getInstance().post(szRequest, HttpIds.ADMIN_PERMS);
    FortResponse response = RestUtils.unmarshall(szResponse);
    if (response.getErrorCode() == 0)
    {
        retPerms = response.getEntities();
        Session outSession = response.getSession();
        session.copy(outSession);
    }
    else
    {
        throw new SecurityException(response.getErrorCode(), response.getErrorMessage());
    }
    return retPerms;
    //throw new java.lang.UnsupportedOperationException();
}
 
开发者ID:apache,项目名称:directory-fortress-core,代码行数:29,代码来源:DelAccessMgrRestImpl.java

示例5: canAssign

import org.apache.directory.fortress.core.model.Session; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public boolean canAssign(Session session, User user, Role role)
    throws SecurityException
{
    String methodName = CLS_NM + ".canAssign";
    VUtil.assertNotNull(session, GlobalErrIds.USER_SESS_NULL, methodName);
    VUtil.assertNotNull(user, GlobalErrIds.USER_NULL, methodName);
    VUtil.assertNotNull(role, GlobalErrIds.ROLE_NULL, methodName);
    boolean result;
    FortRequest request = new FortRequest();
    request.setContextId(this.contextId);
    UserRole uRole = new UserRole(user.getUserId(), role.getName());
    request.setSession(session);
    request.setEntity(uRole);
    String szRequest = RestUtils.marshal(request);
    String szResponse = RestUtils.getInstance().post(szRequest, HttpIds.ADMIN_ASSIGN);
    FortResponse response = RestUtils.unmarshall(szResponse);
    if (response.getErrorCode() == 0)
    {
        result = response.getAuthorized();
        Session outSession = response.getSession();
        session.copy(outSession);
    }
    else
    {
        throw new SecurityException(response.getErrorCode(), response.getErrorMessage());
    }
    return result;
}
 
开发者ID:apache,项目名称:directory-fortress-core,代码行数:33,代码来源:DelAccessMgrRestImpl.java

示例6: canDeassign

import org.apache.directory.fortress.core.model.Session; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public boolean canDeassign(Session session, User user, Role role)
    throws SecurityException
{
    String methodName = CLS_NM + ".canDeassign";
    VUtil.assertNotNull(session, GlobalErrIds.USER_SESS_NULL, methodName);
    VUtil.assertNotNull(user, GlobalErrIds.USER_NULL, methodName);
    VUtil.assertNotNull(role, GlobalErrIds.ROLE_NULL, methodName);
    boolean result;
    FortRequest request = new FortRequest();
    request.setContextId(this.contextId);
    UserRole uRole = new UserRole(user.getUserId(), role.getName());
    request.setSession(session);
    request.setEntity(uRole);
    String szRequest = RestUtils.marshal(request);
    String szResponse = RestUtils.getInstance().post(szRequest, HttpIds.ADMIN_DEASSIGN);
    FortResponse response = RestUtils.unmarshall(szResponse);
    if (response.getErrorCode() == 0)
    {
        result = response.getAuthorized();
        Session outSession = response.getSession();
        session.copy(outSession);
    }
    else
    {
        throw new SecurityException(response.getErrorCode(), response.getErrorMessage());
    }
    return result;
}
 
开发者ID:apache,项目名称:directory-fortress-core,代码行数:33,代码来源:DelAccessMgrRestImpl.java

示例7: canGrant

import org.apache.directory.fortress.core.model.Session; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public boolean canGrant(Session session, Role role, Permission perm)
    throws SecurityException
{
    String methodName = CLS_NM + "canGrant";
    VUtil.assertNotNull(session, GlobalErrIds.USER_SESS_NULL, methodName);
    VUtil.assertNotNull(perm, GlobalErrIds.PERM_OBJECT_NULL, methodName);
    VUtil.assertNotNull(role, GlobalErrIds.ROLE_NULL, methodName);
    boolean result;
    FortRequest request = new FortRequest();
    request.setContextId(this.contextId);
    RolePerm context = new RolePerm();
    context.setPerm(perm);
    context.setRole(role);
    request.setSession(session);
    request.setEntity(context);
    String szRequest = RestUtils.marshal(request);
    String szResponse = RestUtils.getInstance().post(szRequest, HttpIds.ADMIN_GRANT);
    FortResponse response = RestUtils.unmarshall(szResponse);
    if (response.getErrorCode() == 0)
    {
        result = response.getAuthorized();
        Session outSession = response.getSession();
        session.copy(outSession);
    }
    else
    {
        throw new SecurityException(response.getErrorCode(), response.getErrorMessage());
    }
    return result;
}
 
开发者ID:apache,项目名称:directory-fortress-core,代码行数:35,代码来源:DelAccessMgrRestImpl.java

示例8: canRevoke

import org.apache.directory.fortress.core.model.Session; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public boolean canRevoke(Session session, Role role, Permission perm)
    throws SecurityException
{
    String methodName = CLS_NM + "canRevoke";
    VUtil.assertNotNull(session, GlobalErrIds.USER_SESS_NULL, methodName);
    VUtil.assertNotNull(perm, GlobalErrIds.PERM_OBJECT_NULL, methodName);
    VUtil.assertNotNull(role, GlobalErrIds.ROLE_NULL, methodName);
    boolean result;
    FortRequest request = new FortRequest();
    request.setContextId(this.contextId);
    RolePerm context = new RolePerm();
    context.setPerm(perm);
    context.setRole(role);
    request.setSession(session);
    request.setEntity(context);
    String szRequest = RestUtils.marshal(request);
    String szResponse = RestUtils.getInstance().post(szRequest, HttpIds.ADMIN_REVOKE);
    FortResponse response = RestUtils.unmarshall(szResponse);
    if (response.getErrorCode() == 0)
    {
        result = response.getAuthorized();
        Session outSession = response.getSession();
        session.copy(outSession);
    }
    else
    {
        throw new SecurityException(response.getErrorCode(), response.getErrorMessage());
    }
    return result;
}
 
开发者ID:apache,项目名称:directory-fortress-core,代码行数:35,代码来源:DelAccessMgrRestImpl.java

示例9: checkAccess

import org.apache.directory.fortress.core.model.Session; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public boolean checkAccess(Session session, Permission perm)
    throws SecurityException
{
    String methodName = CLS_NM + ".checkAccess";
    VUtil.assertNotNull(perm, GlobalErrIds.PERM_NULL, methodName);
    VUtil.assertNotNullOrEmpty(perm.getOpName(), GlobalErrIds.PERM_OPERATION_NULL, methodName);
    VUtil.assertNotNullOrEmpty(perm.getObjName(), GlobalErrIds.PERM_OBJECT_NULL, methodName);
    VUtil.assertNotNull(session, GlobalErrIds.USER_SESS_NULL, methodName);
    boolean result;
    FortRequest request = new FortRequest();
    request.setContextId(this.contextId);
    request.setSession(session);
    request.setEntity(perm);
    String szRequest = RestUtils.marshal(request);
    String szResponse = RestUtils.getInstance().post(szRequest, HttpIds.ADMIN_AUTHZ);
    FortResponse response = RestUtils.unmarshall(szResponse);
    if (response.getErrorCode() == 0)
    {
        result = response.getAuthorized();
        Session outSession = response.getSession();
        session.copy(outSession);
    }
    else
    {
        throw new SecurityException(response.getErrorCode(), response.getErrorMessage());
    }
    return result;
}
 
开发者ID:apache,项目名称:directory-fortress-core,代码行数:33,代码来源:DelAccessMgrRestImpl.java

示例10: authorizedAdminRoles

import org.apache.directory.fortress.core.model.Session; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public Set<String> authorizedAdminRoles(Session session)
    throws SecurityException
{
    VUtil.assertNotNull(session, GlobalErrIds.USER_SESS_NULL, CLS_NM + ".authorizedAdminRoles");
    Set<String> retRoleNames = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);
    FortRequest request = new FortRequest();
    request.setContextId(this.contextId);
    request.setSession(session);
    String szRequest = RestUtils.marshal(request);
    String szResponse = RestUtils.getInstance().post(szRequest, HttpIds.ADMIN_AUTHZ_ROLES);
    FortResponse response = RestUtils.unmarshall(szResponse);
    if (response.getErrorCode() == 0)
    {
        Set<String> tempNames = response.getValueSet();
        // This is done to use a case insensitive TreeSet for returned names.
        retRoleNames.addAll(tempNames);
        Session outSession = response.getSession();
        session.copy(outSession);
    }
    else
    {
        throw new SecurityException(response.getErrorCode(), response.getErrorMessage());
    }
    return retRoleNames;
    //throw new java.lang.UnsupportedOperationException();
}
 
开发者ID:apache,项目名称:directory-fortress-core,代码行数:31,代码来源:DelAccessMgrRestImpl.java


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