private String getFlushCommand(File file, FileAttributes fileAttributes) {
   StorageInfo storageInfo = StorageInfos.extractFrom(fileAttributes);
   StringBuilder sb = new StringBuilder(command);
   sb.append(" put ").append(fileAttributes.getPnfsId()).append(' ').append(file.getPath());
   sb.append(" -si=").append(storageInfo.toString());
   sb.append(options);
   LOGGER.debug("COMMAND: {}", sb);
   return sb.toString();
 }
Example #2
0
  public String ac_check_osm_$_2(Args args) throws Exception {
    String store = args.argv(0);
    String bfid = args.argv(1);
    StorageInfo si = new OSMStorageInfo(store, "", bfid);

    getBfDetails(si);

    String result = si.getKey("hsm.details");

    return result == null ? "No Details" : result;
  }
 private String getFetchCommand(File file, FileAttributes attributes) {
   StorageInfo storageInfo = StorageInfos.extractFrom(attributes);
   StringBuilder sb = new StringBuilder(command);
   sb.append(" get ").append(attributes.getPnfsId()).append(' ').append(file.getPath());
   sb.append(" -si=").append(storageInfo.toString());
   for (URI location : getLocations(attributes)) {
     if (location.getScheme().equals(type) && location.getAuthority().equals(name)) {
       sb.append(" -uri=").append(location.toString());
     }
   }
   sb.append(options);
   LOGGER.debug("COMMAND: {}", sb);
   return sb.toString();
 }
 private FileAttributes getFileAttributesForNotification(Set<URI> uris) throws CacheException {
   FileAttributes fileAttributes = descriptor.getFileAttributes();
   StorageInfo storageInfo = fileAttributes.getStorageInfo().clone();
   for (URI uri : uris) {
     try {
       HsmLocationExtractorFactory.validate(uri);
       storageInfo.addLocation(uri);
       storageInfo.isSetAddLocation(true);
     } catch (IllegalArgumentException e) {
       throw new CacheException(2, e.getMessage(), e);
     }
   }
   FileAttributes fileAttributesForNotification = new FileAttributes();
   fileAttributesForNotification.setAccessLatency(fileAttributes.getAccessLatency());
   fileAttributesForNotification.setRetentionPolicy(fileAttributes.getRetentionPolicy());
   fileAttributesForNotification.setStorageInfo(storageInfo);
   fileAttributesForNotification.setSize(fileAttributes.getSize());
   return fileAttributesForNotification;
 }
Example #5
0
  private void getBfDetails(StorageInfo storageInfo) throws Exception {
    String hsm = storageInfo.getHsm();
    if ((hsm == null) || (hsm.equals(""))) {
      throw new IllegalArgumentException("Hsm not specified");
    }

    Object[] values = _driverMap.get(hsm);
    if (values == null) {
      throw new IllegalArgumentException("Driver not found for hsm=" + hsm);
    }

    HsmControllable hc = (HsmControllable) values[1];
    _log.info("Controller found for " + hsm + " -> " + values[0]);
    hc.getBfDetails(storageInfo);
  }