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
23 protected String name;
37 public String toString (){
43 * This static method gets a storage instance associated with a native
44 * storage of your platform. This is the best way to get a java storage object.
46 * @param name The name of the storage to get.
48 * @return The storage object with the given name.
49 * @exception StorageNotFoundException if the name of the storage is not valid.
50 * @exception NativeException if the native version of this method failed.
52 public native static Storage getByName(String name)
53 throws HostNotFoundException, NullPointerException, NativeException, StorageNotFoundException;
56 * This method returns the name of a storage.
57 * @return The name of the storage.
60 public String getName() {
65 * This method returns the size (in bytes) of a storage element.
67 * @return The size (in bytes) of the storage element.
70 public native long getSize();
73 * This method returns the free size (in bytes) of a storage element.
75 * @return The free size (in bytes) of the storage element.
78 public native long getFreeSize();
81 * This method returns the used size (in bytes) of a storage element.
83 * @return The used size (in bytes) of the storage element.
86 public native long getUsedSize();
89 * Returns the value of a given storage property.
91 public native String getProperty(String name);
94 * Change the value of a given storage property.
96 public native void setProperty(String name, String value);
101 * Returns the host name the storage is attached to
103 * @return the host name the storage is attached to
105 public native String getHost();
108 * This static method returns all of the storages of the installed platform.
110 * @return An array containing all the storages installed.
113 public native static Storage[] all();
116 * Class initializer, to initialize various JNI stuff
118 public static native void nativeInit();