1 /* Bindings to the MSG storage */
3 /* Copyright (c) 2006-2014. 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
21 protected String name;
31 public String toString (){
37 * This static method gets a storage instance associated with a native
38 * storage of your platform. This is the best way to get a java storage object.
40 * @param name The name of the storage to get.
42 * @return The storage object with the given name.
43 * @exception StorageNotFoundException if the name of the storage is not valid.
45 public static native Storage getByName(String name)
46 throws HostNotFoundException, StorageNotFoundException;
49 * This method returns the name of a storage.
50 * @return The name of the storage.
53 public String getName() {
58 * This method returns the size (in bytes) of a storage element.
60 * @return The size (in bytes) of the storage element.
63 public native long getSize();
66 * This method returns the free size (in bytes) of a storage element.
68 * @return The free size (in bytes) of the storage element.
71 public native long getFreeSize();
74 * This method returns the used size (in bytes) of a storage element.
76 * @return The used size (in bytes) of the storage element.
79 public native long getUsedSize();
82 * Returns the value of a given storage property.
84 public native String getProperty(String name);
87 * Change the value of a given storage property.
89 public native void setProperty(String name, String value);
94 * Returns the host name the storage is attached to
96 * @return the host name the storage is attached to
98 public native String getHost();
101 * This static method returns all of the storages of the installed platform.
103 * @return An array containing all the storages installed.
106 public static native Storage[] all();
109 * Class initializer, to initialize various JNI stuff
111 public static native void nativeInit();