Пример #1
0
 public List<RichDestination> call(ApiCaller ac, Deserializer parms) throws PerunException {
   if (parms.contains("facility")) {
     return ac.getServicesManager()
         .getAllRichDestinations(ac.getSession(), ac.getFacilityById(parms.readInt("facility")));
   } else {
     return ac.getServicesManager()
         .getAllRichDestinations(ac.getSession(), ac.getServiceById(parms.readInt("service")));
   }
 }
Пример #2
0
    @Override
    public Void call(ApiCaller ac, Deserializer parms) throws PerunException {
      ac.stateChangingCheck();

      if (parms.contains("vo")) {
        ac.getExtSourcesManager()
            .removeExtSource(
                ac.getSession(),
                ac.getVoById(parms.readInt("vo")),
                ac.getExtSourceById(parms.readInt("source")));
      } else if (parms.contains("group")) {
        ac.getExtSourcesManager()
            .removeExtSource(
                ac.getSession(),
                ac.getGroupById(parms.readInt("group")),
                ac.getExtSourceById(parms.readInt("source")));
      } else {
        throw new RpcException(RpcException.Type.MISSING_VALUE, "vo or group");
      }

      return null;
    }