本文整理汇总了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;
}
示例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);
}
}
示例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;
}
示例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);
}
示例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());
}
示例6: DomainObjectInfo
import org.springframework.security.acls.model.ObjectIdentity; //导入方法依赖的package包/类
public DomainObjectInfo(ObjectIdentity oid) {
super();
this.id = (String) oid.getIdentifier();
this.type = oid.getType();
}
示例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();
}