// Path: src/main/java/org/fixtrading/timpani/securitydef/messages/SecurityDefinition.java
// public interface SecurityDefinition extends Message {
// 
//   interface InstrAttrib {
//     // tag 871
//     InstrAttribType getInstrAttribType();
// 
//     // tag 872
//     String getInstrAttribValue();
//   }
//   
//   interface MarketSegment {
// 
//     // tag 1301
//     String getMarketID();
// 
//     // tag 1300
//     String getMarketSegmentID();
//   }
// 
//   // tag 870
//   int getNoInstrAttrib();
// 
//   InstrAttrib getInstrAttrib(int index);
//   
//   // tag 1310
//   int getNoMarketSegments();
// 
//   MarketSegment getMarketSegment(int index);
//   
//   // tag 461
//   String getCfiCode();
// 
//   // tag 231
//   double getContractMultiplier();
// 
//   // tag 15
//   String getCurrency();
// 
//   // tag 779
//   LocalDateTime getLastUpdateTime();
// 
//   // tag 1142
//   String getMatchAlgorithm();
// 
//   // tag 200
//   String getMaturityMonthYear();
// 
//   // tag 1140
//   int getMaxTradeVol();
// 
//   // tag 969
//   double getMinPriceIncrement();
// 
//   // tag 460 - int
//   Product getProduct();
// 
//   // tag 201 - int
//   PutOrCall getPutOrCall();
// 
//   // tag 107
//   String getSecurityDesc();
// 
//   // tag 207
//   String getSecurityExchange();
// 
//   // tag 1151
//   String getSecurityGroup();
// 
//   // tag 48
//   String getSecurityID();
// 
//   // tag 22
//   SecurityIDSource getSecurityIDSource();
// 
//   // tag 1607
//   SecurityRejectReason getSecurityRejectReason();
// 
//   // tag 320
//   String getSecurityReqID();
// 
//   // tag 560
//   SecurityRequestResult getSecurityRequestResult();
// 
//   // tag 323
//   SecurityResponseType getSecurityResponseType();
// 
//   // tag 167
//   String getSecurityType();
// 
//   // tag 120
//   String getSettlCurrency();
// 
//   // tag 731 - int
//   SettlPriceType getSettlPriceType();
// 
//   // tag 202
//   double getStrikePrice();
// 
//   // tag 23
//   SubscriptionRequestType getSubscriptionRequestType();
// 
//   // tag 55
//   String getSymbol();
// 
//   // tag 336
//   String getTradingSessionID();
// 
//   // tag 625
//   String getTradingSessionSubID();
// 
//   // tag 462 - int
//   Product getUnderlyingProduct();
// 
// 
// }
// 
// Path: src/main/java/org/fixtrading/timpani/securitydef/messages/SecurityDefinitionRequest.java
// public interface SecurityDefinitionRequest extends Message {
// 
//   String getCfiCode();
// 
//   String getMarketID();
// 
//   String getMarketSegmentID();
// 
//   String getProduct();
// 
//   // tag 207
//   String getSecurityExchange();
//   
//   // tag 1151
//   String getSecurityGroup();
//   
//   String getSecurityReqID();
// 
//   SecurityRequestType getSecurityRequestType();
// 
//   String getSecurityType();
// 
//   SubscriptionRequestType getSubscriptionRequestType();
// 
//   String getSymbol();
// 
//   String getTradingSessionID();
// 
//   String getTradingSessionSubID();
// 
//   void setCfiCode(String cfiCode);
// 
// }


import java.util.Collection;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import org.fixtrading.timpani.securitydef.messages.SecurityDefinition;
import org.fixtrading.timpani.securitydef.messages.SecurityDefinitionRequest;
/**
 * Copyright 2016 FIX Protocol Ltd
 *
 * Licensed 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.fixtrading.timpani.securitydef.datastore;



/**
 * Interface for security definition data store
 * 
 * @author Don Mendelson
 *
 */
public interface SecurityDefinitionStore extends AutoCloseable {

  /**
   * Delete a security definition that matches the characteristics of the request
   * 
   * @param securityDefinitionRequest a request
   * @return future provides asynchronous result
   */
  CompletableFuture<SecurityDefinitionStore> delete(
      SecurityDefinitionRequest securityDefinitionRequest);

  /**
   * Insert a collection of security definitions into the store
   * 
   * @param securityDefinitions a collection of populated objects
   * @return future provides asynchronous result
   */
  CompletableFuture<SecurityDefinitionStore> insert(
      Collection<SecurityDefinition> securityDefinitions);

  /**
   * Insert a single security definition into the store
   * 
   * @param securityDefinition a populated object
   * @return future provides asynchronous result
   */
  CompletableFuture<SecurityDefinitionStore> insert(SecurityDefinition securityDefinition);

  /**
   * Open communications with the data store. It must be opened successfully before any other
   * operations may be executed.
   * 
   * @return future provides asynchronous result
   */
  CompletableFuture<SecurityDefinitionStore> open();

  /**
   * Retrieve security definitions from the store that fulfill the request
   * 
   * @param securityDefinitionRequest a populated request
   * @param consumer of selected security definitions
   * @return future signals when operation is complete and returns the total
   * number of security definitions returned
   */
  CompletableFuture<Integer> select(
      SecurityDefinitionRequest securityDefinitionRequest,
// Path: src/main/java/org/fixtrading/timpani/securitydef/messages/SecurityDefinition.java
// public interface SecurityDefinition extends Message {
// 
//   interface InstrAttrib {
//     // tag 871
//     InstrAttribType getInstrAttribType();
// 
//     // tag 872
//     String getInstrAttribValue();
//   }
//   
//   interface MarketSegment {
// 
//     // tag 1301
//     String getMarketID();
// 
//     // tag 1300
//     String getMarketSegmentID();
//   }
// 
//   // tag 870
//   int getNoInstrAttrib();
// 
//   InstrAttrib getInstrAttrib(int index);
//   
//   // tag 1310
//   int getNoMarketSegments();
// 
//   MarketSegment getMarketSegment(int index);
//   
//   // tag 461
//   String getCfiCode();
// 
//   // tag 231
//   double getContractMultiplier();
// 
//   // tag 15
//   String getCurrency();
// 
//   // tag 779
//   LocalDateTime getLastUpdateTime();
// 
//   // tag 1142
//   String getMatchAlgorithm();
// 
//   // tag 200
//   String getMaturityMonthYear();
// 
//   // tag 1140
//   int getMaxTradeVol();
// 
//   // tag 969
//   double getMinPriceIncrement();
// 
//   // tag 460 - int
//   Product getProduct();
// 
//   // tag 201 - int
//   PutOrCall getPutOrCall();
// 
//   // tag 107
//   String getSecurityDesc();
// 
//   // tag 207
//   String getSecurityExchange();
// 
//   // tag 1151
//   String getSecurityGroup();
// 
//   // tag 48
//   String getSecurityID();
// 
//   // tag 22
//   SecurityIDSource getSecurityIDSource();
// 
//   // tag 1607
//   SecurityRejectReason getSecurityRejectReason();
// 
//   // tag 320
//   String getSecurityReqID();
// 
//   // tag 560
//   SecurityRequestResult getSecurityRequestResult();
// 
//   // tag 323
//   SecurityResponseType getSecurityResponseType();
// 
//   // tag 167
//   String getSecurityType();
// 
//   // tag 120
//   String getSettlCurrency();
// 
//   // tag 731 - int
//   SettlPriceType getSettlPriceType();
// 
//   // tag 202
//   double getStrikePrice();
// 
//   // tag 23
//   SubscriptionRequestType getSubscriptionRequestType();
// 
//   // tag 55
//   String getSymbol();
// 
//   // tag 336
//   String getTradingSessionID();
// 
//   // tag 625
//   String getTradingSessionSubID();
// 
//   // tag 462 - int
//   Product getUnderlyingProduct();
// 
// 
// }
// 
// Path: src/main/java/org/fixtrading/timpani/securitydef/messages/SecurityDefinitionRequest.java
// public interface SecurityDefinitionRequest extends Message {
// 
//   String getCfiCode();
// 
//   String getMarketID();
// 
//   String getMarketSegmentID();
// 
//   String getProduct();
// 
//   // tag 207
//   String getSecurityExchange();
//   
//   // tag 1151
//   String getSecurityGroup();
//   
//   String getSecurityReqID();
// 
//   SecurityRequestType getSecurityRequestType();
// 
//   String getSecurityType();
// 
//   SubscriptionRequestType getSubscriptionRequestType();
// 
//   String getSymbol();
// 
//   String getTradingSessionID();
// 
//   String getTradingSessionSubID();
// 
//   void setCfiCode(String cfiCode);
// 
// }


// Path: src/main/java/org/fixtrading/timpani/securitydef/datastore/SecurityDefinitionStore.java
import java.util.Collection;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import org.fixtrading.timpani.securitydef.messages.SecurityDefinition;
import org.fixtrading.timpani.securitydef.messages.SecurityDefinitionRequest;

/**
 * Copyright 2016 FIX Protocol Ltd
 *
 * Licensed 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.fixtrading.timpani.securitydef.datastore;



/**
 * Interface for security definition data store
 * 
 * @author Don Mendelson
 *
 */
public interface SecurityDefinitionStore extends AutoCloseable {

  /**
   * Delete a security definition that matches the characteristics of the request
   * 
   * @param securityDefinitionRequest a request
   * @return future provides asynchronous result
   */
  CompletableFuture<SecurityDefinitionStore> delete(
      SecurityDefinitionRequest securityDefinitionRequest);

  /**
   * Insert a collection of security definitions into the store
   * 
   * @param securityDefinitions a collection of populated objects
   * @return future provides asynchronous result
   */
  CompletableFuture<SecurityDefinitionStore> insert(
      Collection<SecurityDefinition> securityDefinitions);

  /**
   * Insert a single security definition into the store
   * 
   * @param securityDefinition a populated object
   * @return future provides asynchronous result
   */
  CompletableFuture<SecurityDefinitionStore> insert(SecurityDefinition securityDefinition);

  /**
   * Open communications with the data store. It must be opened successfully before any other
   * operations may be executed.
   * 
   * @return future provides asynchronous result
   */
  CompletableFuture<SecurityDefinitionStore> open();

  /**
   * Retrieve security definitions from the store that fulfill the request
   * 
   * @param securityDefinitionRequest a populated request
   * @param consumer of selected security definitions
   * @return future signals when operation is complete and returns the total
   * number of security definitions returned
   */
  CompletableFuture<Integer> select(
      SecurityDefinitionRequest securityDefinitionRequest,
      Consumer<? extends SecurityDefinition> consumer);