Esempio n. 1
0
 @Override
 public List<String> findGroupNamesByUser(CallingContext context, String username) {
   List<String> result = Lists.newArrayList();
   FindGroupsByUserFilter filter = new FindGroupsByUserFilter(username);
   List<RaptureEntitlementGroup> groups = RaptureEntitlementGroupStorage.filterAll(filter);
   for (RaptureEntitlementGroup group : groups) {
     result.add(group.getName());
   }
   return result;
 }
Esempio n. 2
0
 @Override
 public Map<String, String> getSystemProperties(CallingContext context, List<String> keys) {
   Map<String, String> ret = new TreeMap<String, String>();
   if (keys.isEmpty()) {
     ret.putAll(System.getenv());
     Properties p = System.getProperties();
     for (Map.Entry<Object, Object> prop : p.entrySet()) {
       ret.put(prop.getKey().toString(), prop.getValue().toString());
     }
   } else {
     for (String k : keys) {
       String val = System.getenv(k);
       if (val != null) {
         ret.put(k, System.getenv(k));
       } else {
         String prop = System.getProperty(k);
         if (prop != null) {
           ret.put(k, prop);
         }
       }
     }
   }
   return ret;
 }