final RelationshipDirection relationshipDirection, ObjectType type, OperationContext context) {
final String objectId = getObjectId();
final String typeId = (type == null ? null : type.getId());
final RelationshipService relationshipService = getBinding().getRelationshipService();
final OperationContext ctxt = new OperationContextImpl(context);
return new CollectionIterable<Relationship>(new AbstractPageFetch<Relationship>(ctxt.getMaxItemsPerPage()) {
@Override
protected AbstractPageFetch.PageFetchResult<Relationship> fetchPage(long skipCount) {
// fetch the relationships
ObjectList relList = relationshipService.getObjectRelationships(getRepositoryId(), objectId,
includeSubRelationshipTypes, relationshipDirection, typeId, ctxt.getFilterString(), ctxt
.isIncludeAllowableActions(), BigInteger.valueOf(this.maxNumItems), BigInteger
.valueOf(skipCount), null);
// convert relationship objects
List<Relationship> page = new ArrayList<Relationship>();