public static class Item extends DtoBase { // internal field, only put on by the hibernate annoation mapping layer, not seen by users, so shouldn't be in their filter/sort. public static final String WrapperFilterName = "sequence_workflow_entry"; @FilterName(ApiStrings.SequenceWorkflowEntry.Arguments.SEQUENCE_WORKFLOW_ID) public Long sequenceWorkflowId; @FilterName(WrapperFilterName) @SortName(WrapperFilterName) @HibernateWrappedItem("sequenceWorkflowEntry") public SequenceWorkflowEntry sequenceWorkflowEntry; } }
public boolean isInRepository( ApiDirectRepository repository ) { final ApiDirectRepository currentMode = ApiDirectRepository.forValue(getRepository()); return (currentMode == repository); }
public static void setReference(Document document, String reference){ setReference(document.getMetadata(), reference); }
private void setupPreevaluatedInformation(Document document) { // Check if we have any supplied metadata which has been evaluated before. ConditionEngineResult result = conditionEngineMetadata.createResult(document.getMetadata()); applyEvaluationInfo(result, this); }
private String getProjectIdAllowingForAdminApi( ){ // Get the thread scoped admin context. AdminUserContext adminUserContext = applicationContext.getBean(AdminUserContext.class); if ( adminUserContext != null && adminUserContext.isAllowAdministration() ) { return null; } return userContext.getProjectId(); } }
protected String getProjectId() { return userContext != null ? userContext.getProjectId() : null; }
@Override public boolean getAvailable() { return !elasticsearchProperties.isElasticsearchDisabled(); }
private static String getNameFromAnnotationInstance( Annotation annotation ) { if (annotation instanceof FilterName) { return ((FilterName) annotation).value(); } else if (annotation instanceof SortName) { return ((SortName) annotation).value(); } else if (annotation instanceof HibernateWrappedItem) { return ((HibernateWrappedItem) annotation).value(); } return annotation.toString(); }
@Override public void validate(Policy policy) throws Exception { if (this.policyType == null) { // Policy type is either setup by Id or by using our Internal name. // In the case of the MetadataPolicyConvertor its name must be what is // in front of the JSON property- x_Convertor prefix. e.g. MetadataPolicy_Converter this.policyType = this.policyApi.retrievePolicyType(policy.typeId); } // Validate the json in this policy against the schema held for the given policyType. policyApi.validate(policy, policyType); }
/*** * This is an ORd result, so if we are in any of the modes supplied we return true. */ public boolean isInApiMode( Collection<ApiMode> modes ) { for ( ApiProperties.ApiMode mode : modes ) { if (isInApiMode(mode)) return true; } return false; }
@Override public Condition deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { DtoDeserializer dtoDeserializer = new DtoDeserializer(); return (Condition)dtoDeserializer.deserialize(jp, ctxt); } }
public String getReference() { return ReferenceExtractor.getReference(this); }
public void setReference(String reference) { ReferenceExtractor.setReference(this, reference); }
public void setReference(String reference){ ReferenceExtractor.setReferenceAsMetadataValue(this.metadata, reference, apiProperties); }
private Collection<Policy> getPolicies(Collection<Long> policyIds) { return policyApi.retrievePolicies(policyIds); }
public String getHashPassword(){ return getSetting("engine.hash.password", "{g<tg}>Gc%PbtC$uY4xx4>#H)FX}*'"); }
public static <String> CaseInsensitiveKeyMultimap<String> create(){ return new CaseInsensitiveKeyMultimap<>(); }
@Override public void validate(Policy policy) throws Exception { if(this.policyType==null){ // Policy type is either setup by Id or by using our Internal name. // In the case of the MetadataPolicyConvertor its name must be what is // in front of the JSON property- x_Convertor prefix. e.g. MetadataPolicy_Converter this.policyType = this.policyApi.retrievePolicyType( policy.typeId ); } // Validate the json in this policy against the schema held for the given policyType. policyApi.validate( policy, policyType ); }
@Override public void validate(Policy policy) throws Exception { if (this.policyType == null) { // as the custom policies can have any internal_name we need to use ID, instead of internal_name this.policyType = this.policyApi.retrievePolicyType(policy.typeId); } // Validate the json in this policy against the schema held for the given policyType. policyApi.validate(policy, policyType); }