Beispiel #1
0
    @Override
    public Void call(ApiCaller ac, Deserializer parms) throws PerunException {
      ac.stateChangingCheck();

      ac.getServicesManager().updateService(ac.getSession(), parms.read("service", Service.class));
      return null;
    }
Beispiel #2
0
 public List<RichDestination> call(ApiCaller ac, Deserializer parms) throws PerunException {
   return ac.getServicesManager()
       .getRichDestinations(
           ac.getSession(),
           ac.getFacilityById(parms.readInt("facility")),
           ac.getServiceById(parms.readInt("service")));
 }
Beispiel #3
0
    @Override
    public Owner call(ApiCaller ac, Deserializer parms) throws PerunException {
      ac.stateChangingCheck();

      return ac.getServicesManager()
          .getOwner(ac.getSession(), ac.getServiceById(parms.readInt("service")));
    }
 @Override
 public Void call(ApiCaller ac, Deserializer parms) throws PerunException {
   ac.stateChangingCheck();
   ac.getExtSourcesManager()
       .deleteExtSource(ac.getSession(), ac.getExtSourceById(parms.readInt("id")));
   return null;
 }
Beispiel #5
0
    @Override
    public ServicesPackage call(ApiCaller ac, Deserializer parms) throws PerunException {
      ac.stateChangingCheck();

      return ac.getServicesManager()
          .createServicesPackage(
              ac.getSession(), parms.read("servicesPackage", ServicesPackage.class));
    }
Beispiel #6
0
 @Override
 public ServiceAttributes call(ApiCaller ac, Deserializer parms) throws PerunException {
   return ac.getServicesManager()
       .getDataWithGroups(
           ac.getSession(),
           ac.getServiceById(parms.readInt("service")),
           ac.getFacilityById(parms.readInt("facility")));
 }
Beispiel #7
0
    @Override
    public List<User> call(ApiCaller ac, Deserializer parms) throws PerunException {
      ac.stateChangingCheck();

      return ac.getSearcher()
          .getUsers(
              ac.getSession(), parms.read("attributesWithSearchingValues", LinkedHashMap.class));
    }
Beispiel #8
0
    @Override
    public Void call(ApiCaller ac, Deserializer parms) throws PerunException {
      ac.stateChangingCheck();

      ac.getServicesManager()
          .removeAllRequiredAttributes(
              ac.getSession(), ac.getServiceById(parms.readInt("service")));
      return null;
    }
Beispiel #9
0
    @Override
    public Service call(ApiCaller ac, Deserializer parms) throws PerunException {
      ac.stateChangingCheck();

      return ac.getServicesManager()
          .createService(
              ac.getSession(),
              parms.read("service", Service.class),
              ac.getOwnerById(parms.readInt("owner")));
    }
Beispiel #10
0
    @Override
    public List<Destination> call(ApiCaller ac, Deserializer parms) throws PerunException {
      ac.stateChangingCheck();

      return ac.getServicesManager()
          .addDestinationsForAllServicesOnFacility(
              ac.getSession(),
              ac.getFacilityById(parms.readInt("facility")),
              ac.getDestination(parms.readString("destination"), parms.readString("type")));
    }
Beispiel #11
0
    @Override
    public List<Destination> call(ApiCaller ac, Deserializer parms) throws PerunException {
      ac.stateChangingCheck();

      return ac.getServicesManager()
          .addDestinationsDefinedByHostsOnCluster(
              ac.getSession(),
              ac.getServiceById(parms.readInt("service")),
              ac.getFacilityById(parms.readInt("facility")));
    }
Beispiel #12
0
    @Override
    public List<Member> call(ApiCaller ac, Deserializer parms) throws PerunException {
      ac.stateChangingCheck();

      return ac.getSearcher()
          .getMembersByUserAttributes(
              ac.getSession(),
              ac.getVoById(parms.readInt("vo")),
              parms.read("userAttributesWithSearchingValues", LinkedHashMap.class));
    }
Beispiel #13
0
    @Override
    public Void call(ApiCaller ac, Deserializer parms) throws PerunException {
      ac.stateChangingCheck();

      ac.getServicesManager()
          .addServiceToServicesPackage(
              ac.getSession(),
              ac.getServicesPackageById(parms.readInt("servicesPackage")),
              ac.getServiceById(parms.readInt("service")));
      return null;
    }
Beispiel #14
0
    @Override
    public Void call(ApiCaller ac, Deserializer parms) throws PerunException {
      ac.stateChangingCheck();

      ac.getServicesManager()
          .removeAllDestinations(
              ac.getSession(),
              ac.getServiceById(parms.readInt("service")),
              ac.getFacilityById(parms.readInt("facility")));

      return null;
    }
Beispiel #15
0
    @Override
    public Void call(ApiCaller ac, Deserializer parms) throws PerunException {
      ac.stateChangingCheck();

      int[] ids = parms.readArrayOfInts("attributes");
      List<AttributeDefinition> attributes = new ArrayList<AttributeDefinition>(ids.length);

      for (int i : ids) {
        attributes.add(ac.getAttributeDefinitionById(i));
      }

      ac.getServicesManager()
          .removeRequiredAttributes(
              ac.getSession(), ac.getServiceById(parms.readInt("service")), attributes);
      return null;
    }
    @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;
    }
 @Override
 public ExtSource call(ApiCaller ac, Deserializer parms) throws PerunException {
   return ac.getExtSourceById(parms.readInt("id"));
 }
Beispiel #18
0
 @Override
 public List<Service> call(ApiCaller ac, Deserializer parms) throws PerunException {
   return ac.getServicesManager()
       .getServicesByAttributeDefinition(
           ac.getSession(), ac.getAttributeDefinitionById(parms.readInt("attributeDefinition")));
 }
 @Override
 public Void call(ApiCaller ac, Deserializer parms) throws PerunException {
   ac.getExtSourcesManager().loadExtSourcesDefinitions(ac.getSession());
   return null;
 }
 @Override
 public ExtSource call(ApiCaller ac, Deserializer parms) throws PerunException {
   ac.stateChangingCheck();
   return ac.getExtSourcesManager()
       .createExtSource(ac.getSession(), parms.read("extSource", ExtSource.class));
 }
 @Override
 public List<ExtSource> call(ApiCaller ac, Deserializer parms) throws PerunException {
   return ac.getExtSourcesManager().getExtSources(ac.getSession());
 }
Beispiel #22
0
 @Override
 public Destination call(ApiCaller ac, Deserializer parms) throws PerunException {
   return ac.getServicesManager().getDestinationById(ac.getSession(), parms.readInt("id"));
 }
Beispiel #23
0
    @Override
    public List<Destination> call(ApiCaller ac, Deserializer parms) throws PerunException {

      return ac.getServicesManager()
          .getFacilitiesDestinations(ac.getSession(), ac.getVoById(parms.readInt("vo")));
    }
Beispiel #24
0
 @Override
 public ServicesPackage call(ApiCaller ac, Deserializer parms) throws PerunException {
   return ac.getServicesPackageById(parms.readInt("servicesPackageId"));
 }
Beispiel #25
0
 @Override
 public List<Service> call(ApiCaller ac, Deserializer parms) throws PerunException {
   return ac.getServicesManager()
       .getServicesFromServicesPackage(
           ac.getSession(), ac.getServicesPackageById(parms.readInt("servicesPackage")));
 }
 @Override
 public ExtSource call(ApiCaller ac, Deserializer parms) throws PerunException {
   return ac.getExtSourcesManager()
       .getExtSourceByName(ac.getSession(), parms.readString("name"));
 }
 @Override
 public List<ExtSource> call(ApiCaller ac, Deserializer parms) throws PerunException {
   return ac.getExtSourcesManager()
       .getGroupExtSources(ac.getSession(), ac.getGroupById(parms.readInt("group")));
 }
Beispiel #28
0
    @Override
    public List<Service> call(ApiCaller ac, Deserializer parms) throws PerunException {

      return ac.getServicesManager()
          .getAssignedServices(ac.getSession(), ac.getFacilityById(parms.readInt("facility")));
    }