Serializable
, Cloneable
, Map<Object,Object>
public class Organisation extends Properties
Each user on the grid is bound to an organisation, which is specified in the certificate's subject. This class provides additional information about these organisations.
This ad-hoc class parses the organisation configuration file, and queries
information from that. The configuration file contains metadata for certificate
DNs and addresses of registration authorities. Currently, only user
certificates are supported (the cert.users
namespace) and registration
authorities (ra
namespace).
An organisation is one <id>
in the cert.users.<id>
namespace, from the point of view of the configuration file.
The configuration file is loaded using Class.getResource(java.lang.String)
from
/resources/conf/cert_signup.conf
.
When an organisation-unit is specified by RDN (which are the relevant
O
and OU
parts of the certificate subject), both the
organisation unit (OU
) and the organisation (O
) need to
be specified. To be able to use one identifier, x-full-rdn
was
introduced, which is a comma-separated list of organisations and
organisation units. This is used to refer to an organisation or one of
the sub-units, and is fully derivable from a certificate subject.
Modifier and Type | Class | Description |
---|---|---|
static class |
Organisation.RA |
Registration authorities associated with grid organisations
|
Modifier and Type | Field | Description |
---|---|---|
protected static HashMap<String,Organisation> |
orgIndex |
global list of all organisations, indexed by configfile index
|
protected static HashMap<String,Organisation> |
orgRdn |
global list of all organisations, indexed by x-full-rdn
|
protected static HashMap<String,Organisation.RA> |
ras |
global list of all registration authorities
|
defaults
Modifier | Constructor | Description |
---|---|---|
protected |
Organisation(String id) |
Create a new origanisation
|
Modifier and Type | Method | Description |
---|---|---|
void |
copyTo(Properties p,
String prefix) |
Copy all properties to a Properties instance.
|
static Organisation |
get(String xfullrdn) |
Get an organisation by identifier.
|
static Organisation[] |
getAll() |
Return the list of organisations
|
static String |
getAllOptionsHTML() |
|
static String |
getAllOptionsHTML(boolean signupOnly) |
|
static String |
getAllOptionsHTML(CertificatePair cert) |
|
static String |
getAllOptionsHTML(CertificatePair cert,
boolean signupOnly) |
Return html fragment with list options for all organisations
|
String |
getDescriptionHTML() |
Returns the organisation's description in html
|
protected static InputStream |
getFile() |
Retrieves organisation file
|
static Organisation |
getFromCertificate(CertificatePair cert) |
Returns the Organisation belonging to a CertificatePair, or
null of not found. |
String |
getLookupUrl() |
Returns link to website for doing an RA lookup for this organisation.
|
String |
getNameHTML() |
Returns the organisation's name in html
|
String |
getOptionHTML() |
Returns an html <option> tag for embedding in a <select> tag
|
Organisation |
getParent() |
Return the parent for this sub-unit, or
null if none. |
String |
getProperty(String key) |
Generated properties.
|
Organisation |
getSubUnit(String ou) |
Return a sub-unit for this organisation
|
protected static void |
readAll() |
Load the list of organisations from the configuration file
|
finalize, getClass, notify, notifyAll, wait, wait, wait
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, getProperty, hashCode, isEmpty, keys, keySet, list, list, load, load, loadFromXML, merge, propertyNames, put, putAll, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, save, setProperty, size, store, store, storeToXML, storeToXML, storeToXML, stringPropertyNames, toString, values
protected static HashMap<String,Organisation> orgIndex
protected static HashMap<String,Organisation> orgRdn
protected static HashMap<String,Organisation.RA> ras
protected Organisation(String id)
public static Organisation get(String xfullrdn)
This returns the organisation as read from the configuration file.
If the organisation is not found, however, a new Organisation
object is returned which has id and name set to the argument org
.
Comparison with existing organisation is done case-insensitively. It is assumed that all organisation names in the configuration file are lower-case.
xfullrdn
- x-full-rdn
identifiernull
if org
was null
itself.public static Organisation[] getAll()
protected static void readAll()
protected static InputStream getFile() throws IOException
Tries to retrieve it from the location specified in the global configuration, falls back to file supplied with distribution.
IOException
public static Organisation getFromCertificate(CertificatePair cert)
null
of not found.
When the certificate property org
is present, it returns that. Otherwise it
parses the certificate's organisations and returns the most probable one.
TODO check property and certificate subject are not out-of-sync
public static String getAllOptionsHTML(CertificatePair cert, boolean signupOnly)
Returns a list of <option> elements to put in an html select. The CertificatePair supplied is verified to exist in the options, or else a new option is added that has no existing organisation from the configuration file. This is needed to be able to support organisations that are not present in the configuration file.
cert
- CertificatePair to include organisation fromsignupOnly
- whether to restrict options to organisations for which one can signuppublic static String getAllOptionsHTML(CertificatePair cert)
public static String getAllOptionsHTML(boolean signupOnly)
public static String getAllOptionsHTML()
public String getProperty(String key)
Each property ending with .full
becomes a comma-separated
list of the key (without .full
) for its parents up to itself.
getProperty
in class Properties
public String getDescriptionHTML() throws UnsupportedEncodingException
UnsupportedEncodingException
public String getNameHTML() throws UnsupportedEncodingException
UnsupportedEncodingException
public String getOptionHTML()
public String getLookupUrl()
TODO make this configurable
public void copyTo(Properties p, String prefix)
These are volatile attributes since they are bound to an organisation, not a Certificate.
public Organisation getSubUnit(String ou)
public Organisation getParent()
null
if none.Copyright © 2010-2018 Nikhef / Stichting FOM. All Rights Reserved.