/*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF 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.
*
*/
using log4net;
using Apache.Qpid.Integration.Tests.framework.Circuit;
using Apache.Qpid.Integration.Tests.framework.TestClientDetails;
using org.apache.qpid.util.ConversationFactory;
using System.Collections.Generic.LinkedList;
using System.Collections.Generic.IList;
using java.util.Properties;
namespace Apache.Qpid.Integration.Tests.framework.sequencers
{
///
/// BaseCircuitFactory provides some functionality common to all s, such as the details of
/// all s that make up the end-points of
/// the circuits that the factory creates, and an active that can be used to generate
/// control conversations with those circuit end-points.
///
///
CRC Card
///
Responsibilities
Collaborations
///
Hold the details of the sending and receiving end-points to create circuits from.
///
Provide a conversation factory to create control conversations with the end-points.
///
///
public abstract class BaseCircuitFactory : CircuitFactory
{
/// Used for debugging.
private static ILog log = LogManager.GetLogger(typeof(BaseCircuitFactory));
/// Holds the contact details for the sending test client.
protected TestClientDetails sender;
/// Holds the contact details for the receving test client.
protected IList receivers = new LinkedList();
/// Holds the conversation factory over which to coordinate the test.
protected ConversationFactory conversationFactory;
///
/// Creates a test circuit for the test, configered by the test parameters specified.
///
/// The test parameters.
/// A test circuit.
public Circuit createCircuit(Properties testProperties)
{
throw new RuntimeException("Not implemented.");
}
///
/// Sets the sender test client to coordinate the test with.
///
/// The contact details of the sending client in the test.
public void setSender(TestClientDetails sender)
{
log.debug("public void setSender(TestClientDetails sender = " + sender + "): called");
this.sender = sender;
}
///
/// Sets the receiving test client to coordinate the test with.
///
/// The contact details of the sending client in the test.
public void setReceiver(TestClientDetails receiver)
{
log.debug("public void setReceiver(TestClientDetails receivers = " + receiver + "): called");
this.receivers.add(receiver);
}
///
/// Supplies the sending test client.
///
/// The sending test client.
public TestClientDetails getSender()
{
return sender;
}
///
/// Supplies the receiving test client.
///
/// The receiving test client.
public IList getReceivers()
{
return receivers;
}
///
/// Accepts the conversation factory over which to hold the test coordinating conversation.
///
/// The conversation factory to coordinate the test over.
public void setConversationFactory(ConversationFactory conversationFactory)
{
this.conversationFactory = conversationFactory;
}
///
/// Provides the conversation factory for providing the distributed test sequencing conversations over the test
/// connection.
///
/// The conversation factory to create test sequencing conversations with.
public ConversationFactory getConversationFactory()
{
return conversationFactory;
}
}
}