/*
(non-Javadoc)

@see org.restcomm.protocols.ss7.tcap.api.tc.dialog.DialogPrimitiveFactory
#createEnd(org.restcomm.protocols.ss7.tcap.api.tc.dialog.Dialog)
775569
public TCResponseRequest createResponse(Dialog d) {
        if (d == null) {
            throw new NullPointerException("Dialog is null");
        }
        TCResponseRequestImpl tcer = new TCResponseRequestImpl();
        tcer.setDialog(d);
        tcer.setOriginatingAddress(d.getLocalAddress());
        return tcer;
    }
476290
function createEndpointFromPath(path, query, filePath) {
  filePath = filePath || path;
  return createEndpointFromObject(path, query, getJSON(filePath));
}
1288797
private void cmdAddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmdAddActionPerformed
    	// Open a save dialog if it is a new query
		JDialog saveDialog = new JDialog();
		saveDialog.setTitle("New Query");
		saveDialog.setModalityType(ModalityType.MODELESS);
		
		SaveQueryPanel savePanel = new SaveQueryPanel("", saveDialog, queryController);
		saveDialog.getContentPane().add(savePanel, java.awt.BorderLayout.CENTER);
		saveDialog.pack();
		
		DialogUtils.centerDialogWRTParent(this, saveDialog);
		DialogUtils.installEscapeCloseOperation(saveDialog);
		
		saveDialog.setVisible(true);
    }
447582
@Override
    public ExitMessage newExitMessage(final Object result, final Message message) {
        return new SimpleExitMessage(exitText, result, message);
    }
477054
public HSlicePredicate<N> setEndOn(N finish) {
    this.finish = finish;
    predicateType = PredicateType.Range;
    return this;
  }
304916
public static EntityCreateOperation<NotificationEndPointInfo> create(
            String name, EndPointType endPointType, String endPointAddress) {
        return new Creator(name, endPointType, endPointAddress);
    }
864987
public static void updateEnd(final Annotation annotation, final int end)
    {
        annotation.removeFromIndexes();
        annotation.setEnd(end);
        annotation.addToIndexes();
    }
389643
public int getMessageUserDataLengthOnSend() throws MAPException {

        try {
            switch (this.tcapDialog.getState()) {
                case Idle:
                    ApplicationContextName acn = this.mapProviderImpl.getTCAPProvider().getDialogPrimitiveFactory()
                            .createApplicationContextName(this.appCntx.getOID());

                    TCBeginRequest tb = this.mapProviderImpl.encodeTCBegin(this.getTcapDialog(), acn, destReference,
                            origReference, this.extContainer, this.eriStyle, this.eriMsisdn, this.eriVlrNo);
                    return tcapDialog.getDataLength(tb);

                case Active:
                    // Its Active send TC-CONTINUE

                    TCContinueRequest tc = this.mapProviderImpl.encodeTCContinue(this.getTcapDialog(), false, null, null);
                    return tcapDialog.getDataLength(tc);

                case InitialReceived:
                    // Its first Reply to TC-Begin

                    ApplicationContextName acn1 = this.mapProviderImpl.getTCAPProvider().getDialogPrimitiveFactory()
                            .createApplicationContextName(this.appCntx.getOID());

                    tc = this.mapProviderImpl.encodeTCContinue(this.getTcapDialog(), true, acn1, this.extContainer);
                    return tcapDialog.getDataLength(tc);
            }
        } catch (TCAPSendException e) {
            throw new MAPException("TCAPSendException when getMessageUserDataLengthOnSend", e);
        }

        throw new MAPException("Bad TCAP Dialog state: " + this.tcapDialog.getState());
    }
663504
public void setEnd(ReadableInstant end) {
        long endMillis = DateTimeUtils.getInstantMillis(end);
        super.setInterval(getStartMillis(), endMillis, getChronology());
    }
898510
private void createDestination(String name, 
                                 com.ibm.wsspi.sib.core.DestinationType destType,
                                 Reliability defaultReliability)
    throws JMSException
  {
    if (tcInt.isEntryEnabled())
      SibTr.entry(tcInt, "createDestination(String, DestinationType)");
      
    if (tcInt.isDebugEnabled())
    {
      SibTr.debug(tcInt, "name: "+name);
      SibTr.debug(tcInt, "type: "+destType);
    }
    
    try
    {

      try
      {
        
        // Obtain information about the destination from the core connection.
        SIDestinationAddress sida = JmsServiceFacade.getSIDestinationAddressFactory().createSIDestinationAddress(name, null);        
        DestinationConfiguration dc = coreConnection.getDestinationConfiguration(sida);
        
        // If the Destination exists, then recreate it.        
        if (dc != null)
        {
          String uuid = dc.getUUID();  
          if (tcInt.isDebugEnabled()) SibTr.debug(tcInt, "delete UUID: "+uuid);
          
          // The destination has been found, so delete it.
          admin.deleteDestinationLocalization(uuid, null);
             
        } else
        {
          if (tcInt.isDebugEnabled())
            SibTr.debug(tcInt, "No object was returned from getDestinationConfiguration");
        }
        
        
      } catch(SINotPossibleInCurrentConfigurationException f)
      {
        // No FFDC code needed
        // This is OK. No action required.
      }      
      
      //lohith liberty change
      
      com.ibm.ws.sib.admin.DestinationDefinition adminDDF = null ; //JsAdminFactory.getInstance(.createDestinationDefinition(destType, name);          
      adminDDF.setMaxReliability(Reliability.ASSURED_PERSISTENT);
      adminDDF.setDefaultReliability(defaultReliability);

      // Set the default exception destination
      String excDestinationName = SIMPConstants.SYSTEM_DEFAULT_EXCEPTION_DESTINATION+getMEName();
      adminDDF.setExceptionDestination(excDestinationName);

      //lohith liberty change
      LocalizationDefinition dloc = null; // JsAdminFactory.getInstance().createLocalizationDefinition(name);
      
      // Make sure the max message count is outside the range used by the tests.
      dloc.setDestinationHighMsgs(30000);

      //lohith liberty change
      admin.createDestinationLocalization(adminDDF, dloc ); //, null, null, null, null);
      
      
    } catch (Exception se)
    {
      // No FFDC code needed
      if (tcInt.isDebugEnabled())
        SibTr.debug(tcInt, "Exception creating", se);
        
      // NB. No need to NLS this because it is only for unit test.
      JMSException jmse =
        new JMSException("Exception received creating destination");
      jmse.setLinkedException(se);
      jmse.initCause(se);
      
      if (tcInt.isEntryEnabled())
         SibTr.exit(tcInt, "createDestination(String, DestinationDefinition)");
      throw jmse;
    }
    
    if (tcInt.isEntryEnabled())
       SibTr.exit(tcInt, "createDestination(String, DestinationDefinition)");

  }
1086712
function endDialog(success, config) {
    if (success) {
        createConfigFile(config);
        console.log();
        process.stdout.write('Succesfully configured gas');
        checkbox.display('green');
        process.exit(0);
    } else {
        console.log(`Only 'y' and 'n' are accepted inputs.`);
        process.stdout.write('Failed to configure gas');
        checkbox.display('red');
        process.exit(1);
    }
}
825539
public TCUniRequest createUni(Dialog d) {
        if (d == null) {
            throw new NullPointerException("Dialog is null");
        }
        TCUniRequestImpl tcur = new TCUniRequestImpl();
        tcur.setDialog(d);
        tcur.setDestinationAddress(d.getRemoteAddress());
        tcur.setOriginatingAddress(d.getLocalAddress());
        return tcur;
    }
169784
@Override
	public Context create(String name, Tree params, CallOptions.Options opts, PacketStream stream, Context parent) {

		// Generate ID
		String id = uid.nextUID();

		// Create new Context
		if (parent == null) {
			return new Context(serviceInvoker, eventbus, id, name, params, opts, stream);
		}

		// Merge meta block
		if (parent.params != null) {
			Tree parentMeta = parent.params.getMeta(false);
			if (parentMeta != null && !parentMeta.isEmpty()) {
				Tree currentMeta = params.getMeta(true);
				if (currentMeta.isEmpty()) {
					currentMeta.setObject(parentMeta.asObject());
				} else {
					currentMeta.copyFrom(parentMeta, false);
				}
			}
		}

		// Verify call level
		if (maxCallLevel > 0 && parent.level >= maxCallLevel) {
			throw new MaxCallLevelError(broker.getNodeID(), maxCallLevel);
		}

		// Create context (nested call)
		return new Context(id, name, params, opts, stream, parent);
	}
223125
public synchronized PacketTransportEndpoint createEndpoint() throws JMSException
    {
        if (closed || transport.isClosed())
            throw new FFMQException("Transport is closed", "TRANSPORT_CLOSED");
        
        PacketTransportEndpoint endpoint = new PacketTransportEndpoint(nextEndpointId++, this);
        registeredEndpoints.put(Integer.valueOf(endpoint.getId()), endpoint);
        return endpoint;
    }
660249
private void cmdCreateNewActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_buttonAcceptActionPerformed
		String id = txtQueryID.getText();
		String group = (String) cmbQueryGroup.getSelectedItem();

		if (id.isEmpty()) {
			JOptionPane.showMessageDialog(this, "The query ID can't be blank!", "Error", JOptionPane.ERROR_MESSAGE);
			return;
		}
		final int index = queryController.getElementPosition(id);
		if (index != -1) {
			JOptionPane.showMessageDialog(this, "The query or group ID already exists!", "Error", JOptionPane.ERROR_MESSAGE);
			return;
		}

		if (group.equals(NOGROUP)) { // no group selected
			queryController.addQuery(query, id);
		} else if (group.equals(NEWGROUP)) { // create a new group
			group = txtGroupName.getText().trim();
			if (group.isEmpty()) {
				JOptionPane.showMessageDialog(this, "The group ID can't be blank!", "Error", JOptionPane.ERROR_MESSAGE);
				return;
			}
			//query and group ID have not yet been added to the queryController elements, but we need to prevent the use of the same name for both
			if (id.equals(group)){
                JOptionPane.showMessageDialog(this, "The group ID can't have the same name as the query ID!", "Error", JOptionPane.ERROR_MESSAGE);
                return;
            }
			try {
				queryController.createGroup(group);
				queryController.addQuery(query, id, group);
			} catch (Exception e) {

                OptionPaneUtils.showPrettyMessageDialog(this, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);

				return;
			}
		} else { // a group selected
			queryController.addQuery(query, id, group);
		}
		parent.dispose();
	}
45656
protected String createWidgetBlockEnd() {

        StringBuffer result = new StringBuffer(8);
        result.append(createWidgetTableEnd());
        result.append(dialogBlockEnd());
        return result.toString();
    }
931902
@Override
    public void endLink(ResourceReference reference, boolean freestanding, Map<String, String> parameters)
    {
        saveEvent(EventType.END_LINK, reference, freestanding, parameters);
    }