Package org.globus.gsi.gridmap

# Class GridMap

java.lang.Object
org.globus.gsi.gridmap.GridMap

All Implemented Interfaces:
  `Serializable`

Direct Known Subclasses:
  `GridMapLocal`

public class GridMap extends Object implements Serializable

See Also:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`protected Map`
`map`

## Constructor Summary

Constructors
Constructor
Description
`GridMap()`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`checkUser(String globusID, String userID)`
Checks if a given globus ID is associated with given local user account.
`String[]`
`getAllGlobusID(String userID)`
Returns all globus IDs associated with the specified local user name.
`static String`
`getDefaultGridMapLocation()`
`String`
`getFileName()`
Returns the absolute path anme of file used to load gridmap either using the `load` or `load` functions.
`String`
`getGlobusID(String userID)`
Returns globus ID associated with the specified local user name.
`boolean`
`getIgnoreErrors()`
Returns whether errors in the gridmap file are ignored.
`String`
`getUserID(String globusID)`
Returns first local user name mapped to the specified globusID.
`String[]`
`getUserIDs(String globusID)`
Returns local user names mapped to the specified globusID.
`boolean`
`load(File file)`
Loads grid map definition from a given file.
`boolean`
`load(InputStream input)`
Loads grid map file definition from a given input stream.
`boolean`
`load(String file)`
Loads grid map definition from a given file.
`void`
`map(String globusID, String userID)`
`static String`
`normalizeDN(String globusID)`
`boolean`
`refresh()`
Reloads the gridmap from a file only if the gridmap was initially loaded using the `load` or `load` functions.
`void`
`setIgnoreErrors(boolean ignoreErrors)`
Sets whether errors in the gridmap file should be ignored.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### map

protected Map map

## Constructor Details

### GridMap

public GridMap()

## Method Details

### setIgnoreErrors

public void setIgnoreErrors(boolean ignoreErrors)
Sets whether errors in the gridmap file should be ignored. Errors are not ignored by default.

Parameters:
  `ignoreErrors` - if true, errors in the gridmap file will be ignored (warnings will be logged). If false, an exception will be raised on errors.

### getIgnoreErrors

public boolean getIgnoreErrors()
Returns whether errors in the gridmap file are ignored.

Returns:
  true if errors in the gridmap file are ignored. False, otherwise.

### getFileName

public String getFileName()
Returns the absolute path anme of file used to load gridmap either using the `load` or `load` functions. If no file was used, returns null.

Returns:
  absolute file path, if gridmap was loaded from file. Null otherwise.

### load

public boolean load(String file) throws IOException
Loads grid map definition from a given file.

Parameters:
  `file` - the grid map file
Returns:
  `true` if the file was parsed and loaded successfully. `False` otherwise.
Throws:
  `IOException` - in case of I/O error or when there are parsing errors in the file (only when errors are not ignored).

### load

public boolean load(File file) throws IOException
Loads grid map definition from a given file.

Parameters:
  `file` - the grid map file
Returns:
  `true` if the file was parsed and loaded successfully. `False` otherwise.
Throws:
  `IOException` - in case of I/O error or when there are parsing errors in the file (only when errors are not ignored).

### refresh

public boolean refresh() throws IOException
Reloads the gridmap from a file only if the gridmap was initially loaded using the `load` or `load` functions. The file will only be reloaded if it has changed since the last time.

Returns:
  `true` if the file was parsed and refreshed successfully. `False` otherwise.
Throws:
  `IOException` - in case of I/O error or when there are parsing errors in the file (only when errors are not ignored).

### load

public boolean load(InputStream input) throws IOException
Loads grid map file definition from a given input stream. The input stream is not closed in case of an error.

Parameters:
  `input` - the input stream that contains the gridmap definitions.
Returns:
  `true` if the input was parsed successfully. `False` otherwise.
Throws:
  `IOException` - in case of I/O error or when there are parsing errors in the input (only when errors are not ignored).

### getUserID

public String getUserID(String globusID)
Returns first local user name mapped to the specified globusID.

Parameters:
  `globusID` - globusID
Returns:
  local user name for the specified globusID. Null if the globusID is not mapped to a local user name.

### getUserIDs

public String[] getUserIDs(String globusID)
Returns local user names mapped to the specified globusID.

Parameters:
  `globusID` - globusID
Returns:
  array of local user names for the specified globusID. Null if the globusID is not mapped to any local user name.

### checkUser

public boolean checkUser(String globusID, String userID)
Checks if a given globus ID is associated with given local user account.

Parameters:
  `globusID` - globus ID
  `userID` - userID
Returns:
  true if globus ID is associated with given local user account, false, otherwise.

### getGlobusID

public String getGlobusID(String userID)
Returns globus ID associated with the specified local user name.

Parameters:
  `userID` - local user name
Returns:
  associated globus ID, null if there is not any.

### getAllGlobusID

public String[] getAllGlobusID(String userID)
Returns all globus IDs associated with the specified local user name.

Parameters:
  `userID` - local user name
Returns:
  associated globus ID, null if there is not any.

### map

public void map(String globusID, String userID)

### normalizeDN

public static String normalizeDN(String globusID)

### getDefaultGridMapLocation

public static String getDefaultGridMapLocation()