Skip to content

Commit b491d63

Browse files
author
Matthew Sackman
committed
merging in from default
2 parents 4269d23 + e2db34d commit b491d63

28 files changed

+958
-47
lines changed

codegen.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,6 @@ def printClassInterfaces():
130130
print " %s %s();" % (java_field_type(spec, a.domain), java_getter_name(a.name))
131131
print " }"
132132
print " }"
133-
134-
135-
def printClone(c):
136-
print
137-
print """ public Object clone()
138-
throws CloneNotSupportedException
139-
{
140-
return super.clone();
141-
}""" % \
142-
{"n": java_class_name(c.name)}
143133

144134
def printReadProperties(c):
145135
print
@@ -180,10 +170,11 @@ def printPropertyDebug(c):
180170

181171
def printClassProperties(c):
182172
print
183-
print " public static class %s extends AMQContentHeader implements Cloneable {" % ( java_class_name(c.name) + 'Properties')
173+
print " public static class %(className)s extends %(parentClass)s {" % {'className' : java_class_name(c.name) + 'Properties', 'parentClass' : 'com.rabbitmq.client.impl.AMQ' + java_class_name(c.name) + 'Properties'}
184174
#property fields
185175
for f in c.fields:
186-
print " public %s %s;" % (java_property_type(spec, f.domain),java_field_name(f.name))
176+
print " private %s %s;" % (java_property_type(spec, f.domain),java_field_name(f.name))
177+
187178
#constructor
188179
if c.fields:
189180
print
@@ -204,13 +195,21 @@ def printClassProperties(c):
204195
print " public %sProperties() {}" % (java_class_name(c.name))
205196
print " public int getClassId() { return %i; }" % (c.index)
206197
print " public java.lang.String getClassName() { return \"%s\"; }" % (c.name)
198+
199+
#access functions
200+
print
201+
for f in c.fields:
202+
print """ public %(fieldType)s get%(capFieldName)s() { return %(fieldName)s; }
203+
public void set%(capFieldName)s(%(fieldType)s %(fieldName)s) { this.%(fieldName)s = %(fieldName)s; }""" % \
204+
{'fieldType' : java_property_type(spec, f.domain), \
205+
'capFieldName' : (java_field_name(f.name)[0].upper() + java_field_name(f.name)[1:]), \
206+
'fieldName' : java_field_name(f.name)}
207207

208-
printClone(c)
209208
printReadProperties(c)
210209
printWriteProperties(c)
211210
printPropertyDebug(c)
212211
print " }"
213-
212+
214213
printHeader()
215214
printConstants()
216215
printClassInterfaces()
Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
// The contents of this file are subject to the Mozilla Public License
2+
// Version 1.1 (the "License"); you may not use this file except in
3+
// compliance with the License. You may obtain a copy of the License at
4+
// http://www.mozilla.org/MPL/
5+
//
6+
// Software distributed under the License is distributed on an "AS IS"
7+
// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
8+
// License for the specific language governing rights and limitations
9+
// under the License.
10+
//
11+
// The Original Code is RabbitMQ.
12+
//
13+
// The Initial Developers of the Original Code are LShift Ltd,
14+
// Cohesive Financial Technologies LLC, and Rabbit Technologies Ltd.
15+
//
16+
// Portions created before 22-Nov-2008 00:00:00 GMT by LShift Ltd,
17+
// Cohesive Financial Technologies LLC, or Rabbit Technologies Ltd
18+
// are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial
19+
// Technologies LLC, and Rabbit Technologies Ltd.
20+
//
21+
// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift
22+
// Ltd. Portions created by Cohesive Financial Technologies LLC are
23+
// Copyright (C) 2007-2009 Cohesive Financial Technologies
24+
// LLC. Portions created by Rabbit Technologies Ltd are Copyright
25+
// (C) 2007-2009 Rabbit Technologies Ltd.
26+
//
27+
// All Rights Reserved.
28+
//
29+
// Contributor(s): ______________________________________.
30+
//
31+
package com.rabbitmq.client;
32+
33+
import java.util.Date;
34+
import java.util.Map;
35+
36+
public interface BasicProperties {
37+
38+
/**
39+
* Retrieve the value in the contentType field.
40+
* @return contentType field, or null if the field has not been set.
41+
*/
42+
public abstract String getContentType();
43+
44+
/**
45+
* Retrieve the value in the contentEncoding field.
46+
* @return contentEncoding field, or null if the field has not been set.
47+
*/
48+
public abstract String getContentEncoding();
49+
50+
/**
51+
* Retrieve the table in the headers field as a map of fields names and
52+
* values.
53+
* @return headers table, or null if the headers field has not been set.
54+
*/
55+
public abstract Map<String, Object> getHeaders();
56+
57+
/**
58+
* Retrieve the value in the deliveryMode field.
59+
* @return deliveryMode field, or null if the field has not been set.
60+
*/
61+
public abstract Integer getDeliveryMode();
62+
63+
/**
64+
* Retrieve the value in the priority field.
65+
* @return priority field, or null if the field has not been set.
66+
*/
67+
public abstract Integer getPriority();
68+
69+
/**
70+
* Retrieve the value in the correlationId field.
71+
* @return correlationId field, or null if the field has not been set.
72+
*/
73+
public abstract String getCorrelationId();
74+
75+
/**
76+
* Retrieve the value in the replyTo field.
77+
* @return replyTo field, or null if the field has not been set.
78+
*/
79+
public abstract String getReplyTo();
80+
81+
/**
82+
* Retrieve the value in the expiration field.
83+
* @return expiration field, or null if the field has not been set.
84+
*/
85+
public abstract String getExpiration();
86+
87+
/**
88+
* Retrieve the value in the messageId field.
89+
* @return messageId field, or null if the field has not been set.
90+
*/
91+
public abstract String getMessageId();
92+
93+
/**
94+
* Retrieve the value in the timestamp field.
95+
* @return timestamp field, or null if the field has not been set.
96+
*/
97+
public abstract Date getTimestamp();
98+
99+
/**
100+
* Retrieve the value in the type field.
101+
* @return type field, or null if the field has not been set.
102+
*/
103+
public abstract String getType();
104+
105+
/**
106+
* Retrieve the value in the userId field.
107+
* @return userId field, or null if the field has not been set.
108+
*/
109+
public abstract String getUserId();
110+
111+
/**
112+
* Retrieve the value in the appId field.
113+
* @return appId field, or null if the field has not been set.
114+
*/
115+
public abstract String getAppId();
116+
117+
/**
118+
* Retrieve the value in the clusterId field.
119+
* @return clusterId field, or null if the field has not been set.
120+
*/
121+
public abstract String getClusterId();
122+
123+
/**
124+
* Set the contentType field, or null indicating the field is not set
125+
* @param contentType the value to set the field to
126+
*/
127+
public abstract void setContentType(String contentType);
128+
129+
/**
130+
* Set the contentEncoding field, or null indicating the field is not set
131+
* @param contentEncoding - the value to set the field to
132+
*/
133+
public abstract void setContentEncoding(String contentEncoding);
134+
135+
/**
136+
* Set the headers table, or null indicating the field is not set
137+
* @param headers a map of table field names and values
138+
*/
139+
public abstract void setHeaders(Map<String, Object> headers);
140+
141+
/**
142+
* Set the deliveryMode field, or null indicating the field is not set
143+
* @param deliveryMode the value to set the field to
144+
*/
145+
public abstract void setDeliveryMode(Integer deliveryMode);
146+
147+
/**
148+
* Set the priority field, or null indicating the field is not set
149+
* @param priority the value to set the field to
150+
*/
151+
public abstract void setPriority(Integer priority);
152+
153+
/**
154+
* Set the correlationId field, or null indicating the field is not set
155+
* @param correlationId the value to set the field to
156+
*/
157+
public abstract void setCorrelationId(String correlationId);
158+
159+
/**
160+
* Set the replyTo field, or null indicating the field is not set
161+
* @param replyTo the value to set the field to
162+
*/
163+
public abstract void setReplyTo(String replyTo);
164+
165+
/**
166+
* Set the expiration field, or null indicating the field is not set
167+
* @param expiration the value to set the field to
168+
*/
169+
public abstract void setExpiration(String expiration);
170+
171+
/**
172+
* Set the messageId field, or null indicating the field is not set
173+
* @param messageId the value to set the field to
174+
*/
175+
public abstract void setMessageId(String messageId);
176+
177+
/**
178+
* Set the timestamp field, or null indicating the field is not set
179+
* @param timestamp the value to set the field to
180+
*/
181+
public abstract void setTimestamp(Date timestamp);
182+
183+
/**
184+
* Set the type field, or null indicating the field is not set
185+
* @param type the value to set the field to
186+
*/
187+
public abstract void setType(String type);
188+
189+
/**
190+
* Set the userId field, or null indicating the field is not set
191+
* @param userId the value to set the field to
192+
*/
193+
public abstract void setUserId(String userId);
194+
195+
/**
196+
* Set the appId field, or null indicating the field is not set
197+
* @param appId the value to set the field to
198+
*/
199+
public abstract void setAppId(String appId);
200+
201+
/**
202+
* Set the clusterId field, or null indicating the field is not set
203+
* @param clusterId the value to set the field to
204+
*/
205+
public abstract void setClusterId(String clusterId);
206+
}

src/com/rabbitmq/client/Channel.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,27 @@ Queue.DeclareOk queueDeclare(String queue, boolean passive, boolean durable, boo
355355
*/
356356
Queue.UnbindOk queueUnbind(String queue, String exchange, String routingKey, Map<String, Object> arguments) throws IOException;
357357

358+
/**
359+
* Purges the contents of the given queue and awaits a completion.
360+
* @see com.rabbitmq.client.AMQP.Queue.Purge
361+
* @see com.rabbitmq.client.AMQP.Queue.PurgeOk
362+
* @param queue the name of the queue
363+
* @return a purge-confirm method if the purge was executed succesfully
364+
* @throws java.io.IOException if an error is encountered
365+
*/
366+
Queue.PurgeOk queuePurge(String queue) throws IOException;
367+
368+
/**
369+
* Purges the contents of the given queue.
370+
* @see com.rabbitmq.client.AMQP.Queue.Purge
371+
* @see com.rabbitmq.client.AMQP.Queue.PurgeOk
372+
* @param queue the name of the queue
373+
* @param nowait whether to await completion of the purge
374+
* @return a purge-confirm method if the purge was executed succesfully
375+
* @throws java.io.IOException if an error is encountered
376+
*/
377+
Queue.PurgeOk queuePurge(String queue, boolean nowait) throws IOException;
378+
358379
/**
359380
* Retrieve a message from a queue using {@link com.rabbitmq.client.AMQP.Basic.Get}
360381
* @see com.rabbitmq.client.AMQP.Basic.Get

src/com/rabbitmq/client/ContentHeader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
* Public API for abstract AMQP content header objects.
3636
*/
3737

38-
public interface ContentHeader {
38+
public interface ContentHeader extends Cloneable {
3939
/**
4040
* Retrieve the class ID (see the spec for a list of allowable IDs).
4141
* @return class ID of this ContentHeader. Properly an unsigned short, i.e. only the lowest 16 bits are significant

0 commit comments

Comments
 (0)