public function getToken($type, $allowCache=true) {
        $tokenName = $type . 'token';
        if (!empty($this->tokencache[$tokenName]) && $allowCache) {
            return $this->tokencache[$tokenName];
        }
        $tokens = $this->getTokens(array($type));
        return $tokens[$tokenName];
    }