private void initLocalQueueUserAclsList() { if (this.userAclsList != null) { return; } QueueUserACLInfoProtoOrBuilder p = viaProto ? proto : builder; List<QueueACLProto> list = p.getUserAclsList(); userAclsList = new ArrayList<QueueACL>(); for (QueueACLProto a : list) { userAclsList.add(convertFromProtoFormat(a)); } }
private void addQueueACLsToProto() { maybeInitBuilder(); builder.clearUserAcls(); if (userAclsList == null) return; Iterable<QueueACLProto> iterable = new Iterable<QueueACLProto>() { @Override public Iterator<QueueACLProto> iterator() { return new Iterator<QueueACLProto>() { Iterator<QueueACL> iter = userAclsList.iterator(); @Override public boolean hasNext() { return iter.hasNext(); } @Override public QueueACLProto next() { return convertToProtoFormat(iter.next()); } @Override public void remove() { throw new UnsupportedOperationException(); } }; } }; builder.addAllUserAcls(iterable); }
private QueueACL convertFromProtoFormat(QueueACLProto q) { return ProtoUtils.convertFromProtoFormat(q); }
private QueueACLProto convertToProtoFormat(QueueACL queueAcl) { return ProtoUtils.convertToProtoFormat(queueAcl); }
public static QueueACLProto convertToProtoFormat(QueueACL e) { return QueueACLProto.valueOf(QUEUE_ACL_PREFIX + e.name()); }
public static QueueACL convertFromProtoFormat(QueueACLProto e) { return QueueACL.valueOf(e.name().replace(QUEUE_ACL_PREFIX, "")); }