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


Java ObjectIdentity.getIdentifier方法代码示例

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


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

示例1: findChildren

import org.springframework.security.acls.model.ObjectIdentity; //导入方法依赖的package包/类
public List<ObjectIdentity> findChildren(ObjectIdentity parentIdentity) {
    Object[] args = {parentIdentity.getIdentifier(), parentIdentity.getType()};
    List<ObjectIdentity> objects = jdbcTemplate.query(findChildrenSql, args,
            new RowMapper<ObjectIdentity>() {
                public ObjectIdentity mapRow(ResultSet rs, int rowNum) throws SQLException {
                    String javaType = rs.getString("class");
                    Long identifier = new Long(rs.getLong("obj_id"));

                    return new ObjectIdentityImpl(javaType, identifier);
                }
            });

    if (objects.size() == 0) {
        return null;
    }

    return objects;
}
 
开发者ID:GovernIB,项目名称:helium,代码行数:19,代码来源:JdbcAclService.java

示例2: readAclsById

import org.springframework.security.acls.model.ObjectIdentity; //导入方法依赖的package包/类
@Override
public Map<ObjectIdentity, Acl> readAclsById(List<ObjectIdentity> oids, List<Sid> sids) throws NotFoundException {
    Message msg = MsgPicker.getMsg();
    Map<ObjectIdentity, Acl> aclMaps = new HashMap<ObjectIdentity, Acl>();
    try {
        for (ObjectIdentity oid : oids) {
            AclRecord record = aclStore.getResource(getQueryKeyById(String.valueOf(oid.getIdentifier())),
                    AclRecord.class, SERIALIZER);
            if (record != null && record.getOwnerInfo() != null) {
                SidInfo owner = record.getOwnerInfo();
                Sid ownerSid = owner.isPrincipal() ? new PrincipalSid(owner.getSid()) : new GrantedAuthoritySid(owner.getSid());
                boolean entriesInheriting = record.isEntriesInheriting();

                Acl parentAcl = null;
                DomainObjectInfo parent = record.getParentDomainObjectInfo();
                if (parent != null) {
                    ObjectIdentity parentObject = new ObjectIdentityImpl(parent.getType(), parent.getId());
                    parentAcl = readAclById(parentObject, null);
                }

                AclImpl acl = new AclImpl(oid, oid.getIdentifier(), aclAuthorizationStrategy, permissionGrantingStrategy, parentAcl, null, entriesInheriting, ownerSid);
                genAces(sids, record, acl);

                aclMaps.put(oid, acl);
            } else {
                throw new NotFoundException(String.format(msg.getACL_INFO_NOT_FOUND(), oid));
            }
        }
        return aclMaps;
    } catch (IOException e) {
        throw new InternalErrorException(e);
    }
}
 
开发者ID:apache,项目名称:kylin,代码行数:34,代码来源:AclService.java

示例3: readAclsById

import org.springframework.security.acls.model.ObjectIdentity; //导入方法依赖的package包/类
@Override
public Map<ObjectIdentity, Acl> readAclsById(List<ObjectIdentity> oids, List<Sid> sids) throws NotFoundException {
    Map<ObjectIdentity, Acl> aclMaps = new HashMap<ObjectIdentity, Acl>();
    HTableInterface htable = null;
    Result result = null;
    try {
        htable = HBaseConnection.get(hbaseUrl).getTable(aclTableName);

        for (ObjectIdentity oid : oids) {
            result = htable.get(new Get(Bytes.toBytes(String.valueOf(oid.getIdentifier()))));

            if (null != result && !result.isEmpty()) {
                SidInfo owner = sidSerializer.deserialize(result.getValue(Bytes.toBytes(ACL_INFO_FAMILY), Bytes.toBytes(ACL_INFO_FAMILY_OWNER_COLUMN)));
                Sid ownerSid = (null == owner) ? null : (owner.isPrincipal() ? new PrincipalSid(owner.getSid()) : new GrantedAuthoritySid(owner.getSid()));
                boolean entriesInheriting = Bytes.toBoolean(result.getValue(Bytes.toBytes(ACL_INFO_FAMILY), Bytes.toBytes(ACL_INFO_FAMILY_ENTRY_INHERIT_COLUMN)));

                Acl parentAcl = null;
                DomainObjectInfo parentInfo = domainObjSerializer.deserialize(result.getValue(Bytes.toBytes(ACL_INFO_FAMILY), Bytes.toBytes(ACL_INFO_FAMILY_PARENT_COLUMN)));
                if (null != parentInfo) {
                    ObjectIdentity parentObj = new ObjectIdentityImpl(parentInfo.getType(), parentInfo.getId());
                    parentAcl = readAclById(parentObj, null);
                }

                AclImpl acl = new AclImpl(oid, oid.getIdentifier(), aclAuthorizationStrategy, permissionGrantingStrategy, parentAcl, null, entriesInheriting, ownerSid);
                genAces(sids, result, acl);

                aclMaps.put(oid, acl);
            } else {
                throw new NotFoundException("Unable to find ACL information for object identity '" + oid + "'");
            }
        }
    } catch (IOException e) {
        throw new RuntimeException(e.getMessage(), e);
    } finally {
        IOUtils.closeQuietly(htable);
    }

    return aclMaps;
}
 
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:40,代码来源:AclService.java

示例4: createObjectIdentity

import org.springframework.security.acls.model.ObjectIdentity; //导入方法依赖的package包/类
/**
 * Create Object Identity
 * 
 * @param object - Object Identity
 * @param owner - Owner Sid
 */
protected void createObjectIdentity(ObjectIdentity object, Sid owner) {
	Assert.isTrue(
			TransactionSynchronizationManager.isSynchronizationActive(),
			"Transaction must be running");
	SidNode sid = createOrRetrieveSid(owner, true);
	ClassNode classNode = createOrRetrieveClass(object.getType(), true);
	AclNode aclNode = new AclNode(Boolean.TRUE,
			(Long) object.getIdentifier(), null, classNode, sid);
	AclNode savedAcl = neo4jTemplate.save(aclNode);
}
 
开发者ID:shazin,项目名称:spring-security-acl-neo4j,代码行数:17,代码来源:Neo4jMutableAclService.java

示例5: from

import org.springframework.security.acls.model.ObjectIdentity; //导入方法依赖的package包/类
public static ObjectIdentityData from(ObjectIdentity objectIdentity) {
    if(objectIdentity == null || objectIdentity instanceof ObjectIdentityData) {
        return (ObjectIdentityData) objectIdentity;
    }
    return new ObjectIdentityData(objectIdentity.getType(), objectIdentity.getIdentifier());
}
 
开发者ID:codeabovelab,项目名称:haven-platform,代码行数:7,代码来源:ObjectIdentityData.java

示例6: DomainObjectInfo

import org.springframework.security.acls.model.ObjectIdentity; //导入方法依赖的package包/类
public DomainObjectInfo(ObjectIdentity oid) {
    super();
    this.id = (String) oid.getIdentifier();
    this.type = oid.getType();
}
 
开发者ID:apache,项目名称:kylin,代码行数:6,代码来源:DomainObjectInfo.java

示例7: AclObjectIdentity

import org.springframework.security.acls.model.ObjectIdentity; //导入方法依赖的package包/类
/**
 * Constructs a new <code>AclObjectIdentity</code> out of the provided {@link ObjectIdentity}.
 * 
 * @param objectIdentity the {@link ObjectIdentity} to use for parameter population.
 */
public AclObjectIdentity(ObjectIdentity objectIdentity) {
	Assert.notNull(objectIdentity, "ObjectIdentity required");
	objectClass = objectIdentity.getType();
	id = (String) objectIdentity.getIdentifier();
}
 
开发者ID:RigasGrigoropoulos,项目名称:spring-security-acl-cassandra,代码行数:11,代码来源:AclObjectIdentity.java


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