@Override public void refreshCallQueue() throws IOException { try { rpcProxy.refreshCallQueue(NULL_CONTROLLER, VOID_REFRESH_CALL_QUEUE_REQUEST); } catch (ServiceException se) { throw ProtobufHelper.getRemoteException(se); } }
@Override public void refreshUserToGroupsMappings() throws IOException { try { rpcProxy.refreshUserToGroupsMappings(NULL_CONTROLLER, VOID_REFRESH_USER_TO_GROUPS_MAPPING_REQUEST); } catch (ServiceException se) { throw ProtobufHelper.getRemoteException(se); } }
@Override public void refreshSuperUserGroupsConfiguration() throws IOException { try { rpcProxy.refreshSuperUserGroupsConfiguration(NULL_CONTROLLER, VOID_REFRESH_SUPERUSER_GROUPS_CONFIGURATION_REQUEST); } catch (ServiceException se) { throw ProtobufHelper.getRemoteException(se); } }
@Override public void refreshServiceAcl() throws IOException { try { rpcProxy.refreshServiceAcl(NULL_CONTROLLER, VOID_REFRESH_SERVICE_ACL_REQUEST); } catch (ServiceException se) { throw ProtobufHelper.getRemoteException(se); } }
@Override public void monitorHealth() throws IOException { try { rpcProxy.monitorHealth(NULL_CONTROLLER, MONITOR_HEALTH_REQ); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } }
@Override public void gracefulFailover() throws IOException, AccessControlException { try { rpcProxy.gracefulFailover(NULL_CONTROLLER, GracefulFailoverRequestProto.getDefaultInstance()); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } }
@Override public SpanReceiverInfo[] listSpanReceivers() throws IOException { ArrayList<SpanReceiverInfo> infos = new ArrayList<SpanReceiverInfo>(1); try { ListSpanReceiversRequestProto req = ListSpanReceiversRequestProto.newBuilder().build(); ListSpanReceiversResponseProto resp = rpcProxy.listSpanReceivers(null, req); for (SpanReceiverListInfo info : resp.getDescriptionsList()) { infos.add(new SpanReceiverInfo(info.getId(), info.getClassName())); } } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } return infos.toArray(new SpanReceiverInfo[infos.size()]); }
@Override public void cedeActive(int millisToCede) throws IOException, AccessControlException { try { CedeActiveRequestProto req = CedeActiveRequestProto.newBuilder() .setMillisToCede(millisToCede) .build(); rpcProxy.cedeActive(NULL_CONTROLLER, req); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } }
@Override public void removeSpanReceiver(long spanReceiverId) throws IOException { try { RemoveSpanReceiverRequestProto req = RemoveSpanReceiverRequestProto.newBuilder() .setId(spanReceiverId).build(); rpcProxy.removeSpanReceiver(null, req); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } }
@Override public String[] getGroupsForUser(String user) throws IOException { GetGroupsForUserRequestProto request = GetGroupsForUserRequestProto .newBuilder().setUser(user).build(); GetGroupsForUserResponseProto resp; try { resp = rpcProxy.getGroupsForUser(NULL_CONTROLLER, request); } catch (ServiceException se) { throw ProtobufHelper.getRemoteException(se); } return resp.getGroupsList().toArray(new String[resp.getGroupsCount()]); }
@Override public Collection<RefreshResponse> refresh(String identifier, String[] args) throws IOException { List<String> argList = Arrays.asList(args); try { GenericRefreshRequestProto request = GenericRefreshRequestProto.newBuilder() .setIdentifier(identifier) .addAllArgs(argList) .build(); GenericRefreshResponseCollectionProto resp = rpcProxy.refresh(NULL_CONTROLLER, request); return unpack(resp); } catch (ServiceException se) { throw ProtobufHelper.getRemoteException(se); } }
@Override public void transitionToActive(StateChangeRequestInfo reqInfo) throws IOException { try { TransitionToActiveRequestProto req = TransitionToActiveRequestProto.newBuilder() .setReqInfo(convert(reqInfo)).build(); rpcProxy.transitionToActive(NULL_CONTROLLER, req); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } }
@Override public void transitionToStandby(StateChangeRequestInfo reqInfo) throws IOException { try { TransitionToStandbyRequestProto req = TransitionToStandbyRequestProto.newBuilder() .setReqInfo(convert(reqInfo)).build(); rpcProxy.transitionToStandby(NULL_CONTROLLER, req); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } }
builder.build()); } catch (ServiceException se) { throw ProtobufHelper.getRemoteException(se);
@Override public HAServiceStatus getServiceStatus() throws IOException { GetServiceStatusResponseProto status; try { status = rpcProxy.getServiceStatus(NULL_CONTROLLER, GET_SERVICE_STATUS_REQ); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } HAServiceStatus ret = new HAServiceStatus( convert(status.getState())); if (status.getReadyToBecomeActive()) { ret.setReadyToBecomeActive(); } else { ret.setNotReadyToBecomeActive(status.getNotReadyReason()); } return ret; }
@Override public long addSpanReceiver(SpanReceiverInfo info) throws IOException { try { AddSpanReceiverRequestProto.Builder bld = AddSpanReceiverRequestProto.newBuilder(); bld.setClassName(info.getClassName()); for (ConfigurationPair configPair : info.configPairs) { ConfigPair tuple = ConfigPair.newBuilder(). setKey(configPair.getKey()). setValue(configPair.getValue()).build(); bld.addConfig(tuple); } AddSpanReceiverResponseProto resp = rpcProxy.addSpanReceiver(null, bld.build()); return resp.getId(); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } }
@Override public long getTransactionID() throws IOException { try { return rpcProxy.getTransactionId(NULL_CONTROLLER, VOID_GET_TRANSACTIONID_REQUEST).getTxId(); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } }
@Override public NamespaceInfo versionRequest() throws IOException { try { return PBHelper.convert(rpcProxy.versionRequest(NULL_CONTROLLER, VOID_VERSION_REQUEST).getInfo()); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } }
@Override public CheckpointSignature rollEditLog() throws IOException { try { return PBHelper.convert(rpcProxy.rollEditLog(NULL_CONTROLLER, VOID_ROLL_EDITLOG_REQUEST).getSignature()); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } }
@Override public long getMostRecentCheckpointTxId() throws IOException { try { return rpcProxy.getMostRecentCheckpointTxId(NULL_CONTROLLER, GetMostRecentCheckpointTxIdRequestProto.getDefaultInstance()).getTxId(); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } }