示例#1
0
 @Override
 public void deleteRemote(CallingContext context, String name) {
   RaptureRemoteStorage.deleteByFields(
       name,
       context.getUser(),
       Messages.getString("Admin.RemoveRemote")); // $NON-NLS-1$ //$NON-NLS-2$
 }
示例#2
0
 @Override
 public void updateRemoteApiKey(CallingContext context, String name, String apiKey) {
   checkParameter(NAME, name);
   checkParameter("ApiKey", apiKey); // $NON-NLS-1$
   RaptureRemote ret = Kernel.INSTANCE.getRemote(name);
   if (ret == null) {
     throw RaptureExceptionFactory.create(
         HttpURLConnection.HTTP_BAD_REQUEST,
         Messages.getString("Admin.NoFindRemote") + name); // $NON-NLS-1$
   } else {
     ret.setApiKey(apiKey);
     RaptureRemoteStorage.add(
         ret, context.getUser(), Messages.getString("Admin.UpdatedApi")); // $NON-NLS-1$
   }
 }
示例#3
0
 @Override
 public RaptureRemote addRemote(
     CallingContext context,
     String name,
     String description,
     String url,
     String apiKey,
     String optPass) {
   checkParameter(NAME, name);
   checkParameter("Url", url); // $NON-NLS-1$
   checkParameter("ApiKey", apiKey); // $NON-NLS-1$
   RaptureRemote ret = new RaptureRemote();
   ret.setName(name);
   ret.setDescription(description);
   ret.setUrl(url);
   ret.setApiKey(apiKey);
   ret.setOptionalPass(optPass);
   RaptureRemoteStorage.add(
       ret, context.getUser(), Messages.getString("Admin.AddRemote")); // $NON-NLS-1$
   return ret;
 }
示例#4
0
 @Override
 public List<RaptureRemote> getRemotes(CallingContext context) {
   return RaptureRemoteStorage.readAll();
 }