PageRenderTime 30ms CodeModel.GetById 13ms app.highlight 14ms RepoModel.GetById 2ms app.codeStats 0ms

/core/externals/update-engine/Core/KSServer.m

http://macfuse.googlecode.com/
Objective C | 96 lines | 58 code | 19 blank | 19 comment | 4 complexity | 72405ae712f99a3c61b57a392f3120d5 MD5 | raw file
 1// Copyright 2008 Google Inc.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#import "KSServer.h"
16
17#import "KSUpdateEngine.h"
18
19@implementation KSServer
20
21- (id)init {
22  return [self initWithURL:nil];
23}
24
25- (id)initWithURL:(NSURL *)url {
26  return [self initWithURL:url params:nil];
27}
28
29- (id)initWithURL:(NSURL *)url params:(NSDictionary *)params {
30  return [self initWithURL:url params:params engine:nil];
31}
32
33- (id)initWithURL:(NSURL *)url params:(NSDictionary *)params
34           engine:(KSUpdateEngine *)engine {
35  if ((self = [super init])) {
36    if (url == nil) {
37      [self release];
38      return nil;
39    }
40    url_ = [url retain];
41    params_ = [params copy];
42    engine_ = [engine retain];
43  }
44  return self;
45}
46
47- (void)dealloc {
48  [url_ release];
49  [params_ release];
50  [engine_ release];
51  [super dealloc];
52}
53
54- (NSURL *)url {
55  return url_;
56}
57
58- (NSDictionary *)params {
59  return params_;
60}
61
62- (KSUpdateEngine *)engine {
63  return engine_;
64}
65
66- (NSString *)description {
67  return [NSString stringWithFormat:@"<%@:%p url=%@, params=%@>",
68          [self class], self, url_, params_];
69}
70
71
72//
73// "Abstract" methods.
74//
75
76
77// Subclasses to override.
78- (NSArray *)requestsForTickets:(NSArray *)tickets {
79  return nil;
80}
81
82// Subclasses can override if they supply OOB information.  Otherwise
83// the default will turn around and use -updateInfosForResponse:data
84- (NSArray *)updateInfosForResponse:(NSURLResponse *)response
85                               data:(NSData *)data
86                      outOfBandData:(NSDictionary **)oob {
87  if (oob) *oob = NULL;
88  return nil;
89}
90
91- (NSString *)prettyPrintResponse:(NSURLResponse *)response
92                             data:(NSData *)data {
93  return nil;
94}
95
96@end