de.fhhannover.inform.trust.ifmapj.identifier
Class Identifiers

java.lang.Object
  extended by de.fhhannover.inform.trust.ifmapj.identifier.Identifiers

public class Identifiers
extends Object

Provides access to Identifier associated classes.

Since:
0.1.4
Author:
aw

Nested Class Summary
static class Identifiers.Helpers
           
 
Method Summary
static AccessRequest createAr(String name)
          Create an access-request identifier with the given name.
static AccessRequest createAr(String name, String admDom)
          Create an access-request identifier with the given name and the given administrative-domain.
static Device createDev(String name)
          Create a device identifier with the given name.
static Identity createIdentity(IdentityType type, String name)
          Create an identity identifier with the given name and the given type.
static Identity createIdentity(IdentityType type, String name, String admDom)
          Create an identity identifier with the given parameters.
static Identity createIdentity(IdentityType type, String name, String admDom, String otherTypeDef)
          Create an identity identifier.
static IpAddress createIp(IpAddressType type, String value, String admDom)
          Create an ip-address identifier with the given parameters.
static IpAddress createIp4(String value)
          Create an ip-address identifier for IPv4 with the given value.
static IpAddress createIp4(String value, String admDom)
          Create an ip-address identifier for IPv4 with the given value and the given administrative-domain.
static IpAddress createIp6(String value)
          Create an ip-address identifier for IPv6 with the given value.
static IpAddress createIp6(String value, String admDom)
          Create an ip-address identifier for IPv6 with the given parameters.
static MacAddress createMac(String value)
          Create a mac-address identifier with the given value.
static MacAddress createMac(String value, String admDom)
          Create a mac-address identifier with the given parameters.
static Identity createOtherIdentity(String name, String admDom, String otherTypeDef)
          Create an other identity identifier.
static Identifier fromElement(Element el)
           
static IdentifierHandler<? extends Identifier> getHandlerFor(Identifier i)
           
static IdentifierFactory getIdentifierFactory()
           
static void registerIdentifierHandler(IdentifierHandler<? extends Identifier> ih)
           
static Element toElement(Identifier i, Document doc)
           
static Identifier tryFromElement(Element el)
           
static Element tryToElement(Identifier i, Document doc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getIdentifierFactory

public static IdentifierFactory getIdentifierFactory()

registerIdentifierHandler

public static void registerIdentifierHandler(IdentifierHandler<? extends Identifier> ih)

getHandlerFor

public static IdentifierHandler<? extends Identifier> getHandlerFor(Identifier i)

tryFromElement

public static final Identifier tryFromElement(Element el)
                                       throws UnmarshalException
Throws:
UnmarshalException

fromElement

public static final Identifier fromElement(Element el)
                                    throws UnmarshalException
Throws:
UnmarshalException

tryToElement

public static final Element tryToElement(Identifier i,
                                         Document doc)

toElement

public static final Element toElement(Identifier i,
                                      Document doc)
                               throws MarshalException
Throws:
MarshalException

createAr

public static AccessRequest createAr(String name)
Create an access-request identifier with the given name. You may optionally set the administrative-domain with IdentifierWithAd.setAdministrativeDomain(String) too (default is left out).

Parameters:
name - the name of the access-request
Returns:
the new AccessRequest instance

createAr

public static AccessRequest createAr(String name,
                                     String admDom)
Create an access-request identifier with the given name and the given administrative-domain.

Parameters:
name - the name of the access-request
admDom - the administrative-domain of the access-request
Returns:
the new AccessRequest instance

createDev

public static Device createDev(String name)
Create a device identifier with the given name.

Parameters:
name - the name of the device identifier
Returns:
the new Device instance

createIdentity

public static Identity createIdentity(IdentityType type,
                                      String name)
Create an identity identifier with the given name and the given type.

Parameters:
type - the type of the identity identifier
name - the name of the identity identifier
Returns:
the new Identity instance

createIdentity

public static Identity createIdentity(IdentityType type,
                                      String name,
                                      String admDom)
Create an identity identifier with the given parameters.

Parameters:
type - the type of the identity identifier
name - the name of the identity identifier
admDom - the administrative-domain of the identity identifier
Returns:
the new Identity instance

createOtherIdentity

public static Identity createOtherIdentity(String name,
                                           String admDom,
                                           String otherTypeDef)
Create an other identity identifier. Note: The type is set to IdentityType.other by default.

Parameters:
name - the name of the identity identifier
admDom - the administrative-domain of the identity identifier
otherTypeDef - vendor specific String
Returns:
the new Identity instance

createIdentity

public static Identity createIdentity(IdentityType type,
                                      String name,
                                      String admDom,
                                      String otherTypeDef)
Create an identity identifier.

Note: otherTypeDef != null should imply type IdentityType.other.

Parameters:
type - the type of the identity identifier
name - the name of the identity identifier
admDom - the administrative-domain of the identity identifier
otherTypeDef - vendor specific String
Returns:
the new Identity instance

createIp4

public static IpAddress createIp4(String value)
Create an ip-address identifier for IPv4 with the given value.

Parameters:
value - a String that represents a valid IPv4 address
Returns:
the new ip-address identifier

createIp4

public static IpAddress createIp4(String value,
                                  String admDom)
Create an ip-address identifier for IPv4 with the given value and the given administrative-domain.

Parameters:
value - a String that represents a valid IPv4 address
admDom - the administrative-domain
Returns:
the new ip-address identifier

createIp6

public static IpAddress createIp6(String value)
Create an ip-address identifier for IPv6 with the given value.

Parameters:
value - a String that represents a valid IPv6 address
Returns:
the new ip-address identifier

createIp6

public static IpAddress createIp6(String value,
                                  String admDom)
Create an ip-address identifier for IPv6 with the given parameters.

Parameters:
value - a String that represents a valid IPv4 address
admDom - the administrative-domain
Returns:
the new ip-address identifier

createIp

public static IpAddress createIp(IpAddressType type,
                                 String value,
                                 String admDom)
Create an ip-address identifier with the given parameters.

Parameters:
type - the type of the ip-address identifier
value - a String that represents a valid IPv4/6 address
admDom - the administrative-domain
Returns:
the new ip-address identifier

createMac

public static MacAddress createMac(String value)
Create a mac-address identifier with the given value.

Parameters:
value - a String that represents a valid MAC address (lower case)
Returns:
the new mac-address identifier

createMac

public static MacAddress createMac(String value,
                                   String admDom)
Create a mac-address identifier with the given parameters.

Parameters:
value - a String that represents a valid MAC address (lower case)
admDom - the administrative-domain
Returns:
the new mac-address identifier


Copyright © 2012 Trust@FHH. All Rights Reserved.