1 /* Bindings to the MSG storage */
3 /* Copyright (c) 2006-2020. The SimGrid Team.
4 * All rights reserved. */
6 /* This program is free software; you can redistribute it and/or modify it
7 * under the terms of the license (GNU LGPL) which comes with this package. */
9 package org.simgrid.msg;
11 public class Storage {
14 * This attribute represents a bind between a java storage object and
15 * a native storage. Even if this attribute is public you must never
18 private long bind = 0;
21 protected String name;
24 public String toString (){
30 * This static method gets a storage instance associated with a native
31 * storage of your platform. This is the best way to get a java storage object.
33 * @param name The name of the storage to get.
35 * @return The storage object with the given name.
36 * @exception StorageNotFoundException if the name of the storage is not valid.
38 public static native Storage getByName(String name)
39 throws HostNotFoundException, StorageNotFoundException;
42 * This method returns the name of a storage.
43 * @return The name of the storage.
46 public String getName() {
51 * This method returns the size (in bytes) of a storage element.
53 * @return The size (in bytes) of the storage element.
56 public native long getSize();
59 * This method returns the free size (in bytes) of a storage element.
61 * @return The free size (in bytes) of the storage element.
64 public native long getFreeSize();
67 * This method returns the used size (in bytes) of a storage element.
69 * @return The used size (in bytes) of the storage element.
72 public native long getUsedSize();
75 * Returns the value of a given storage property.
77 public native String getProperty(String name);
80 * Change the value of a given storage property.
82 public native void setProperty(String name, String value);
87 * Returns the host name the storage is attached to
89 * @return the host name the storage is attached to
91 public native String getHost();
94 * This static method returns all of the storages of the installed platform.
96 * @return An array containing all the storages installed.
99 public static native Storage[] all();
102 * Class initializer, to initialize various JNI stuff
104 public static native void nativeInit();