]> err.no Git - sope/blob - Recycler/SxComponents/SxComponentException.m
make makefiles detect 64bit FHS locations
[sope] / Recycler / SxComponents / SxComponentException.m
1 /*
2   Copyright (C) 2000-2003 SKYRIX Software AG
3
4   This file is part of OGo
5
6   OGo is free software; you can redistribute it and/or modify it under
7   the terms of the GNU Lesser General Public License as published by the
8   Free Software Foundation; either version 2, or (at your option) any
9   later version.
10
11   OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12   WARRANTY; without even the implied warranty of MERCHANTABILITY or
13   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
14   License for more details.
15
16   You should have received a copy of the GNU Lesser General Public
17   License along with OGo; see the file COPYING.  If not, write to the
18   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
19   02111-1307, USA.
20 */
21 // $Id$
22
23 #include "SxComponentException.h"
24 #include "SxBasicAuthCredentials.h"
25 #include "SxComponentInvocation.h"
26 #include "common.h"
27
28 @implementation NSException(SxComponentExceptionTyping)
29
30 - (BOOL)isCredentialsRequiredException {
31   return NO;
32 }
33
34 @end /* NSException(SxComponentExceptionTyping) */
35
36 @implementation SxComponentException
37 @end /* SxComponentException */
38
39 @implementation SxAuthException
40
41 - (id)init {
42   return [self initWithName:NSStringFromClass([self class])
43                reason:nil
44                userInfo:nil];
45 }
46
47 - (void)dealloc {
48   RELEASE(self->invocation);
49   RELEASE(self->credentials);
50   [super dealloc];
51 }
52
53 /* accessors */
54
55 - (BOOL)isCredentialsRequiredException {
56   return YES;
57 }
58
59 - (void)setCredentials:(id)_credentials {
60   ASSIGN(self->credentials, _credentials);
61 }
62 - (id)credentials {
63   return self->credentials;
64 }
65
66 - (void)setInvocation:(SxComponentInvocation *)_invocation {
67   ASSIGN(self->invocation, _invocation);
68 }
69 - (SxComponentInvocation *)invocation {
70   return self->invocation;
71 }
72
73 /* description */
74
75 - (NSString *)description {
76   NSMutableString *ms;
77   id t;
78   
79   ms = [NSMutableString stringWithCapacity:64];
80   [ms appendFormat:@"<0x%08X[%@]: name=%@",
81         self, NSStringFromClass([self class]),
82         [self name]];
83   
84   if ([self isCredentialsRequiredException])
85     [ms appendString:@" cred-required"];
86
87   if ((t = [self credentials]))
88     [ms appendFormat:@" creds=%@", t];
89   
90   if ((t = [self invocation]))
91     [ms appendFormat:@" inv=%@", t];
92   
93   [ms appendString:@">"];
94   
95   return ms;
96 }
97
98 @end /* SxAuthException */
99
100 @implementation SxMissingCredentialsException
101 @end /* SxMissingCredentialsException */
102
103 @implementation SxInvalidCredentialsException
104 @end /* SxInvalidCredentialsException */