'Constructor.
Args:
initializer: A string or another RDFURN.
age: The age of this entry.
base: The base namespace this session id lives in.
queue: The queue to use.
flow_name: The name of this flow or its random id.
Raises:
InitializeError: The given URN cannot be converted to a SessionID.'

def __init__(self, initializer=None, age=None, base='aff4:/flows', queue=DEFAULT_FLOW_QUEUE, flow_name=None):

    if (initializer is None):
        if (flow_name is None):
            flow_name = utils.PRNG.GetULong()
        if isinstance(flow_name, int):
            initializer = RDFURN(base).Add(('%s:%X' % (queue.Basename(), flow_name)))
        else:
            initializer = RDFURN(base).Add(('%s:%s' % (queue.Basename(), flow_name)))
    elif isinstance(initializer, RDFURN):
        try:
            self.ValidateID(initializer.Basename())
        except ValueError as e:
            raise InitializeError(('Invalid    URN    for    SessionID:    %s,    %s' % (initializer, e.message)))
    super(SessionID, self).__init__(initializer=initializer, age=age)
