Skip to content

Commit

Permalink
Merge pull request #1554 from clebertsuconic/master-multiprotocol
Browse files Browse the repository at this point in the history
  • Loading branch information
andytaylor committed Mar 5, 2014
2 parents e435613 + 9cbf4e3 commit dca7e84
Show file tree
Hide file tree
Showing 55 changed files with 3,563 additions and 1,908 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@
*/ */
public interface ClientConsumer extends AutoCloseable public interface ClientConsumer extends AutoCloseable
{ {

/**
* The server's ID associated with this consumer.
* HornetQ implements this as a long but this could be protocol dependent.
* @return
*/
Object getId();

/** /**
* Receives a message from a queue. * Receives a message from a queue.
* <p> * <p>
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ public interface ClientSession extends XAResource, AutoCloseable
/** /**
* Information returned by a binding query * Information returned by a binding query
* *
* @see ClientSession#bindingQuery(SimpleString) * @see ClientSession#addressQuery(SimpleString)
*/ */
public interface BindingQuery public interface AddressQuery
{ {
/** /**
* Returns <code>true</code> if the binding exists, <code>false</code> else. * Returns <code>true</code> if the binding exists, <code>false</code> else.
Expand All @@ -46,6 +46,15 @@ public interface BindingQuery
List<SimpleString> getQueueNames(); List<SimpleString> getQueueNames();
} }


/**
* @deprecated Use {@link org.hornetq.api.core.client.ClientSession.AddressQuery} instead
*/
@Deprecated
public interface BindingQuery extends AddressQuery
{

}

/** /**
* Information returned by a queue query * Information returned by a queue query
* *
Expand All @@ -58,6 +67,11 @@ public interface QueueQuery
*/ */
boolean isExists(); boolean isExists();


/**
* Return <code>true</code> if the queue is temporary, <code>false</code> else.
*/
boolean isTemporary();

/** /**
* Returns <code>true</code> if the queue is durable, <code>false</code> else. * Returns <code>true</code> if the queue is durable, <code>false</code> else.
*/ */
Expand All @@ -82,6 +96,13 @@ public interface QueueQuery
* Returns the address that the queue is bound to. * Returns the address that the queue is bound to.
*/ */
SimpleString getAddress(); SimpleString getAddress();

/**
* Return the name of the queue
*
* @return
*/
SimpleString getName();
} }


// Lifecycle operations ------------------------------------------ // Lifecycle operations ------------------------------------------
Expand Down Expand Up @@ -544,10 +565,10 @@ ClientConsumer createConsumer(SimpleString queueName,
* Queries information on a binding. * Queries information on a binding.
* *
* @param address the address of the biding to query * @param address the address of the biding to query
* @return a BindingQuery containing information on the binding attached to the given address * @return a AddressQuery containing information on the binding attached to the given address
* @throws HornetQException if an exception occurs while querying the binding * @throws HornetQException if an exception occurs while querying the binding
*/ */
BindingQuery bindingQuery(SimpleString address) throws HornetQException; AddressQuery addressQuery(SimpleString address) throws HornetQException;


// Transaction operations ---------------------------------------- // Transaction operations ----------------------------------------


Expand Down Expand Up @@ -639,4 +660,11 @@ ClientConsumer createConsumer(SimpleString queueName,
* @throws HornetQException * @throws HornetQException
*/ */
void addUniqueMetaData(String key, String data) throws HornetQException; void addUniqueMetaData(String key, String data) throws HornetQException;

/**
* Return the sessionFactory used to created this Session.
*
* @return
*/
ClientSessionFactory getSessionFactory();
} }
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
package org.hornetq.api.core.client; package org.hornetq.api.core.client;


import org.hornetq.api.core.HornetQException; import org.hornetq.api.core.HornetQException;
import org.hornetq.core.protocol.core.CoreRemotingConnection; import org.hornetq.spi.core.protocol.RemotingConnection;




/** /**
Expand Down Expand Up @@ -169,5 +169,5 @@ ClientSession createSession(String username,
* *
* @return the core connection * @return the core connection
*/ */
CoreRemotingConnection getConnection(); RemotingConnection getConnection();
} }
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright 2005-2014 Red Hat, Inc.
* Red Hat licenses this file to you under the Apache License, version
* 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

package org.hornetq.core.client.impl;

import java.util.ArrayList;
import java.util.List;

import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.client.ClientSession;

public class AddressQueryImpl implements ClientSession.AddressQuery, ClientSession.BindingQuery
{

private final boolean exists;

private final ArrayList<SimpleString> queueNames;

public AddressQueryImpl(final boolean exists, final List<SimpleString> queueNames)
{
this.exists = exists;
this.queueNames = new ArrayList<SimpleString>(queueNames);
}

public List<SimpleString> getQueueNames()
{
return queueNames;
}

public boolean isExists()
{
return exists;
}
}
Loading

0 comments on commit dca7e84

Please sign in to comment.