/*
(non-Javadoc)

@see org.restcomm.protocols.ss7.isup.ISUPMessageFactory#createFAR()
965382
@Override
    public FacilityRequestMessage createFAR() {
        FacilityRequestMessage msg = new FacilityRequestMessageImpl(_FAR_HOLDER.mandatoryCodes,
                _FAR_HOLDER.mandatoryVariableCodes, _FAR_HOLDER.optionalCodes, _FAR_HOLDER.mandatoryCodeToIndex,
                _FAR_HOLDER.mandatoryVariableCodeToIndex, _FAR_HOLDER.optionalCodeToIndex);

        return msg;
    }
340695
public static String createFile(String fn){
		File file = new File(fn);
		try {
			file.createNewFile();
		}
		catch (IOException e) {
			return e.getMessage();
		}
		return null;
	}
121116
public Message createMessage(final String messageName) {
        final Message[] message = { null };
        for (final Object messageCreator : messageCreators) {
            ReflectionUtils.doWithMethods(messageCreator.getClass(), new ReflectionUtils.MethodCallback() {
                @Override
                public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException {
                    if (method.getAnnotation(MessageCreator.class).value().equals(messageName)) {
                        try {
                            message[0] = (Message) method.invoke(messageCreator);
                        } catch (InvocationTargetException e) {
                            throw new CitrusRuntimeException("Unsupported message creator method: " + method.getName(), e);
                        }
                    }
                }
            }, new ReflectionUtils.MethodFilter() {
                @Override
                public boolean matches(Method method) {
                    return method.getAnnotationsByType(MessageCreator.class).length > 0;
                }
            });
        }

        if (message[0] == null) {
            throw new CitrusRuntimeException("Unable to find message creator for message: " + messageName);
        }

        return message[0];
    }
216768
public FSDataOutputStream create(Path f,
    FsPermission permission,
    boolean overwrite,
    int bufferSize,
    short replication,
    long blockSize,
    Progressable progress) throws IOException {
    try (Closeable context = new TimerContextWithLog(this.createTimer.time(), "create", f, permission, overwrite, bufferSize, replication, blockSize, progress)) {
      return super.create(f, permission, overwrite, bufferSize, replication, blockSize, progress);
    }
  }
282528
protected FtpMessage createDir(CommandType ftpCommand) {
        try {
            sftp.mkdir(ftpCommand.getArguments());
            return FtpMessage.result(FTPReply.PATHNAME_CREATED, "Pathname created", true);
        } catch (SftpException e) {
            throw new CitrusRuntimeException("Failed to execute ftp command", e);
        }
    }
1268031
@Override
    public ContinuityCheckRequestMessage createCCR() {
        ContinuityCheckRequestMessageImpl ccr = new ContinuityCheckRequestMessageImpl(_CCR_HOLDER.mandatoryCodes,
                _CCR_HOLDER.mandatoryVariableCodes, _CCR_HOLDER.optionalCodes, _CCR_HOLDER.mandatoryCodeToIndex,
                _CCR_HOLDER.mandatoryVariableCodeToIndex, _CCR_HOLDER.optionalCodeToIndex);
        return ccr;
    }
813981
public final ControlResetRequestAckAck createNewControlResetRequestAckAck() throws MessageCreateFailedException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewControlResetRequestAckAck");
    ControlResetRequestAckAck msg = null;
    try {
      msg = new ControlResetRequestAckAckImpl(MfpConstants.CONSTRUCTOR_NO_OP);
    }
    catch (MessageDecodeFailedException e) {
      /* No need to FFDC this as JsMsgObject will already have done so */
      // No FFDC code needed
      throw new MessageCreateFailedException(e);
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewControlResetRequestAckAck");
    return msg;
  }
825037
public void create()
          throws SIConnectionUnavailableException, SIConnectionDroppedException, SIErrorException
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "create");

      CommsByteBuffer request = getCommsByteBuffer();
      request.putShort(getConnectionObjectID());

      CommsByteBuffer reply = null;

      try
      {
         // Pass on call to server
         reply = jfapExchange(request,
                              JFapChannelConstants.SEG_CREATE_ORDER_CONTEXT,
                              JFapChannelConstants.PRIORITY_HIGH,
                              true);

         short err = reply.getCommandCompletionCode(JFapChannelConstants.SEG_CREATE_ORDER_CONTEXT_R);
         if (err != CommsConstants.SI_NO_EXCEPTION)
         {
            checkFor_SIConnectionUnavailableException(reply, err);
            checkFor_SIConnectionDroppedException(reply, err);
            checkFor_SIConnectionLostException(reply, err);
            checkFor_SIErrorException(reply, err);
            defaultChecker(reply, err);
         }

         short ocId = reply.getShort();
         if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Created the order proxy. ID: " + ocId);

         // Now save the id
         setProxyID(ocId);
      }
      catch (SIConnectionLostException e)
      {
         // No FFDC Code needed
         // Temporarily re-throw as dropped
         throw new SIConnectionDroppedException("", e);
      }
      finally
      {
         if (reply != null) reply.release();
      }

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "create");
   }
1080857
public TrmMeLinkRequest createNewTrmMeLinkRequest() throws MessageCreateFailedException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewTrmMeLinkRequest");
    TrmMeLinkRequest msg = null;
    try {
      msg = new TrmMeLinkRequestImpl();
    }
    catch (MessageDecodeFailedException e) {
      /* No need to FFDC this as JsMsgObject will already have done so */
      // No FFDC code needed
      throw new MessageCreateFailedException(e);
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewTrmMeLinkRequest");
    return msg;
  }
637304
public TrmMeLinkReply createNewTrmMeLinkReply() throws MessageCreateFailedException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewTrmMeLinkReply");
    TrmMeLinkReply msg = null;
    try {
      msg = new TrmMeLinkReplyImpl();
    }
    catch (MessageDecodeFailedException e) {
      /* No need to FFDC this as JsMsgObject will already have done so */
      // No FFDC code needed
      throw new MessageCreateFailedException(e);
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewTrmMeLinkReply");
    return msg;
  }
1117531
@Override
    public IQueueMessage<ID, DATA> createMessage(DATA content) {
        return messageFactory.createMessage(content);
    }
697306
public boolean createNewFile(Path f) throws IOException {
    if (exists(f)) {
      return false;
    } else {
      create(f, false, getDefaultBufferSize()).close();
      return true;
    }
  }
1245406
@SuppressWarnings("unchecked")
	public T create(Map<String, Object> data)
	{
		Object[] args = new Object[arguments.length];
		for(int i=0, n=args.length; i<n; i++)
		{
			args[i] = arguments[i].getValue(data);
		}

		try
		{
			return (T) raw.newInstance(args);
		}
		catch(IllegalArgumentException e)
		{
			throw new SerializationException("Unable to create; " + e.getMessage(), e);
		}
		catch(InstantiationException e)
		{
			throw new SerializationException("Unable to create; " + e.getMessage(), e);
		}
		catch(IllegalAccessException e)
		{
			throw new SerializationException("Unable to create; " + e.getMessage(), e);
		}
		catch(InvocationTargetException e)
		{
			throw new SerializationException("Unable to create; " + e.getCause().getMessage(), e.getCause());
		}
	}
350366
public FacilityAcceptedMessage createFAA() {
        FacilityAcceptedMessage msg = new FacilityAcceptedMessageImpl(_FAA_HOLDER.mandatoryCodes,
                _FAA_HOLDER.mandatoryVariableCodes, _FAA_HOLDER.optionalCodes, _FAA_HOLDER.mandatoryCodeToIndex,
                _FAA_HOLDER.mandatoryVariableCodeToIndex, _FAA_HOLDER.optionalCodeToIndex);

        return msg;
    }
507757
public TrmMeConnectRequest createNewTrmMeConnectRequest() throws MessageCreateFailedException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewTrmMeConnectRequest");
    TrmMeConnectRequest msg = null;
    try {
      msg = new TrmMeConnectRequestImpl();
    }
    catch (MessageDecodeFailedException e) {
      /* No need to FFDC this as JsMsgObject will already have done so */
      // No FFDC code needed
      throw new MessageCreateFailedException(e);
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewTrmMeConnectRequest");
    return msg;
  }
366382
@SuppressWarnings("unchecked")
    public <T extends BaseWrapper<T>> T create(final Object entity, boolean isRevision) {
        if (entity == null) {
            return null;
        }

        // Create the key
        final DBWrapperKey key = new DBWrapperKey(entity);

        // Check to see if a wrapper has already been cached for the key
        final BaseWrapper cachedWrapper = wrapperCache.get(key);
        if (cachedWrapper != null) {
            return (T) cachedWrapper;
        }

        final DBBaseWrapper wrapper;

        if (entity instanceof ApplicationConfig) {
            // SERVER SETTINGS
            wrapper = new DBServerSettingsWrapper(getProviderFactory(), (ApplicationConfig) entity);
        } else if (entity instanceof EntitiesConfig) {
            // SERVER ENTITIES
            wrapper = new DBServerEntitiesWrapper(getProviderFactory(), (EntitiesConfig) entity);
        } else if (entity instanceof UndefinedEntity) {
            // UNDEFINED ENTITY
            wrapper = new DBServerUndefinedEntityWrapper(getProviderFactory(), (UndefinedEntity) entity);
        } else if (entity instanceof UndefinedSetting) {
            // UNDEFINED SETTING
            wrapper = new DBServerUndefinedSettingWrapper(getProviderFactory(), (UndefinedSetting) entity);
        } else if (entity instanceof Locale) {
            // Locale
            wrapper = new DBLocaleWrapper(getProviderFactory(), (Locale) entity);
        } else if (entity instanceof TranslationServer) {
            // Translation server
            throw new UnsupportedOperationException("A return class needs to be specified for TranslationServer entities.");
        } else if (entity instanceof Topic) {
            // TOPIC
            wrapper = new DBTopicWrapper(getProviderFactory(), (Topic) entity, isRevision);
        } else if (entity instanceof TopicSourceUrl) {
            // TOPIC SOURCE URL
            wrapper = new DBTopicSourceURLWrapper(getProviderFactory(), (TopicSourceUrl) entity, isRevision);
        } else if (entity instanceof TranslatedTopicData) {
            // TRANSLATED TOPIC
            wrapper = new DBTranslatedTopicDataWrapper(getProviderFactory(), (TranslatedTopicData) entity, isRevision);
        } else if (entity instanceof TranslatedTopicString) {
            // TRANSLATED TOPIC STRING
            wrapper = new DBTranslatedTopicStringWrapper(getProviderFactory(), (TranslatedTopicString) entity, isRevision);
        } else if (entity instanceof Tag) {
            // TAG
            wrapper = new DBTagWrapper(getProviderFactory(), (Tag) entity, isRevision);
        } else if (entity instanceof TagToCategory) {
            throw new UnsupportedOperationException("A return class needs to be specified for TagToCategory entities.");
        } else if (entity instanceof Category) {
            // CATEGORY
            wrapper = new DBCategoryWrapper(getProviderFactory(), (Category) entity, isRevision);
        } else if (entity instanceof PropertyTag) {
            // PROPERTY TAGS
            wrapper = new DBPropertyTagWrapper(getProviderFactory(), (PropertyTag) entity, isRevision);
        } else if (entity instanceof TopicToPropertyTag) {
            wrapper = new DBTopicToPropertyTagWrapper(getProviderFactory(), (TopicToPropertyTag) entity, isRevision);
        } else if (entity instanceof TagToPropertyTag) {
            wrapper = new DBTagToPropertyTagWrapper(getProviderFactory(), (TagToPropertyTag) entity, isRevision);
        } else if (entity instanceof ContentSpecToPropertyTag) {
            wrapper = new DBContentSpecToPropertyTagWrapper(getProviderFactory(), (ContentSpecToPropertyTag) entity, isRevision);
        } else if (entity instanceof PropertyTagToPropertyTagCategory) {
            wrapper = new DBPropertyTagToPropertyTagCategoryWrapper(getProviderFactory(), (PropertyTagToPropertyTagCategory) entity,
                    isRevision);
        } else if (entity instanceof BlobConstants) {
            // BLOB CONSTANT
            wrapper = new DBBlobConstantWrapper(getProviderFactory(), (BlobConstants) entity, isRevision);
        } else if (entity instanceof StringConstants) {
            // STRING CONSTANT
            wrapper = new DBStringConstantWrapper(getProviderFactory(), (StringConstants) entity, isRevision);
        } else if (entity instanceof File) {
            // FILE
            wrapper = new DBFileWrapper(getProviderFactory(), (File) entity, isRevision);
        } else if (entity instanceof LanguageFile) {
            // LANGUAGE FILE
            wrapper = new DBLanguageFileWrapper(getProviderFactory(), (LanguageFile) entity, isRevision);
        } else if (entity instanceof ImageFile) {
            // IMAGE
            wrapper = new DBImageWrapper(getProviderFactory(), (ImageFile) entity, isRevision);
        } else if (entity instanceof LanguageImage) {
            // LANGUAGE IMAGE
            wrapper = new DBLanguageImageWrapper(getProviderFactory(), (LanguageImage) entity, isRevision);
        } else if (entity instanceof User) {
            // USER
            wrapper = new DBUserWrapper(getProviderFactory(), (User) entity, isRevision);
        } else if (entity instanceof ContentSpec) {
            // CONTENT SPEC
            throw new UnsupportedOperationException("A return class needs to be specified for ContentSpec entities.");
        } else if (entity instanceof CSNode) {
            // CONTENT SPEC NODE
            wrapper = new DBCSNodeWrapper(getProviderFactory(), (CSNode) entity, isRevision);
        } else if (entity instanceof CSNodeToCSNode) {
            wrapper = new DBCSRelatedNodeWrapper(getProviderFactory(), (CSNodeToCSNode) entity, isRevision);
        } else if (entity instanceof CSInfoNode) {
            // CONTENT SPEC INFO NODE
            wrapper = new DBCSInfoNodeWrapper(getProviderFactory(), (CSInfoNode) entity, isRevision);
        } else if (entity instanceof TranslatedCSNode) {
            // CONTENT SPEC TRANSLATED NODE
            wrapper = new DBTranslatedCSNodeWrapper(getProviderFactory(), (TranslatedCSNode) entity, isRevision);
        } else if (entity instanceof TranslatedCSNodeString) {
            // CONTENT SPEC TRANSLATED NODE STRING
            wrapper = new DBTranslatedCSNodeStringWrapper(getProviderFactory(), (TranslatedCSNodeString) entity, isRevision);
        } else if (entity instanceof CSTranslationDetail) {
            // CONTENT SPEC TRANSLATION DETAIL
            wrapper = new DBCSTranslationDetailWrapper(getProviderFactory(), (CSTranslationDetail) entity);
        } else {
            throw new IllegalArgumentException("Failed to create a Wrapper instance as there is no wrapper available for the Entity.");
        }

        // Add the wrapper to the cache
        wrapperCache.put(key, wrapper);

        return (T) wrapper;
    }
982318
public JsJmsObjectMessage createJmsObjectMessage() throws MessageCreateFailedException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createJmsObjectMessage");
    JsJmsObjectMessage msg = null;
    try {
      msg = new JsJmsObjectMessageImpl(MfpConstants.CONSTRUCTOR_NO_OP);
    }
    catch (MessageDecodeFailedException e) {
      /* No need to FFDC this as JsMsgObject will already have done so */
      // No FFDC code needed
      throw new MessageCreateFailedException(e);
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createJmsObjectMessage");
    return msg;
  }