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.
44 * @exception NativeException if the native version of this method failed.
46 public static native Storage getByName(String name)
47 throws HostNotFoundException, NullPointerException, NativeException, StorageNotFoundException;
50 * This method returns the name of a storage.
51 * @return The name of the storage.
54 public String getName() {
59 * This method returns the size (in bytes) of a storage element.
61 * @return The size (in bytes) of the storage element.
64 public native long getSize();
67 * This method returns the free size (in bytes) of a storage element.
69 * @return The free size (in bytes) of the storage element.
72 public native long getFreeSize();
75 * This method returns the used size (in bytes) of a storage element.
77 * @return The used size (in bytes) of the storage element.
80 public native long getUsedSize();
83 * Returns the value of a given storage property.
85 public native String getProperty(String name);
88 * Change the value of a given storage property.
90 public native void setProperty(String name, String value);
95 * Returns the host name the storage is attached to
97 * @return the host name the storage is attached to
99 public native String getHost();
102 * This static method returns all of the storages of the installed platform.
104 * @return An array containing all the storages installed.
107 public static native Storage[] all();
110 * Class initializer, to initialize various JNI stuff
112 public static native void nativeInit();