/** * {@inheritDoc} */ @Override public boolean equals( Object o ) { if ( !super.equals( o ) ) { return false; } return o instanceof Normalizer; }
buf.append( schemaObject.getOid() ); buf.append( '\n' ); if ( schemaObject.getDescription() != null ) buf.append( schemaObject.getDescription() ); buf.append( '\n' ); if ( schemaObject.getFqcn() != null ) buf.append( schemaObject.getFqcn() ); buf.append( '\n' ); if ( schemaObject.getBytecode() != null ) if ( schemaObject.getBytecode().length() > 16 ) buf.append( schemaObject.getBytecode().substring( 0, 16 ) ); buf.append( schemaObject.getBytecode() ); if ( schemaObject.getExtensions() != null ) getExtensions( buf, schemaObject.getExtensions() );
/** * Process the ByteCode attribute * * @param description The SchemaObject description * @param objectType The SchemaObject type * @return The Attribute containing the byteCode */ private Attribute getByteCode( LoadableSchemaObject description, String objectType ) { String byteCodeString = description.getBytecode(); if ( byteCodeString == null ) { String msg = I18n.err( I18n.ERR_16034_ENTRY_WITHOUT_VALID_AT, objectType, MetaSchemaConstants.M_BYTECODE_AT ); if ( LOG.isWarnEnabled() ) { LOG.warn( msg ); } throw new IllegalArgumentException( msg ); } byte[] bytecode = Base64.decode( byteCodeString.toCharArray() ); return new DefaultAttribute( MetaSchemaConstants.M_BYTECODE_AT, bytecode ); }
/** * Process the FQCN attribute * * @param description The Schema Object description * @param objectType The SchemaObject type * @return The SchemaObject FQCN */ private String getFqcn( LoadableSchemaObject description, String objectType ) { // The FQCN String mFqcn = description.getFqcn(); if ( mFqcn == null ) { String msg = I18n.err( I18n.ERR_16034_ENTRY_WITHOUT_VALID_AT, objectType, MetaSchemaConstants.M_FQCN_AT ); if ( LOG.isWarnEnabled() ) { LOG.warn( msg ); } throw new IllegalArgumentException( msg ); } return mFqcn; }
private SchemaObject copy( SchemaObject schemaObject ) { SchemaObject copy = null; if ( !( schemaObject instanceof LoadableSchemaObject ) ) { copy = schemaObject.copy(); } else { // Check the schemaObject here. if ( ( ( LoadableSchemaObject ) schemaObject ).isValid() ) { copy = schemaObject; } else { // We have an invalid SchemaObject, no need to go any further LdapUnwillingToPerformException error = new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, I18n.err( I18n.ERR_16079_INVALID_SCHEMA_OBJECT_CANNOT_BE_LOADED, schemaObject.getOid() ) ); errorHandler.handle( LOG, error.getMessage(), error ); } } return copy; }
/** * Set the Fully Qualified Class Name for this SchemaObject instance * class stored in the bytecode attribute * @param fqcn The Fully Qualified Class Name */ public void setFqcn( String fqcn ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_13700_CANNOT_MODIFY_LOCKED_SCHEMA_OBJECT, getName() ) ); } this.fqcn = fqcn; }
buf.append( schemaObject.getOid() ); buf.append( '\n' ); if ( schemaObject.getDescription() != null ) buf.append( schemaObject.getDescription() ); buf.append( '\n' ); if ( schemaObject.getFqcn() != null ) buf.append( schemaObject.getFqcn() ); buf.append( '\n' ); if ( schemaObject.getBytecode() != null ) if ( schemaObject.getBytecode().length() > 16 ) buf.append( schemaObject.getBytecode().substring( 0, 16 ) ); buf.append( schemaObject.getBytecode() ); if ( schemaObject.getExtensions() != null ) getExtensions( buf, schemaObject.getExtensions() );
/** * Process the ByteCode attribute * * @param description The SchemaObject description * @param objectType The SchemaObject type * @return The Attribute containing the byteCode */ private Attribute getByteCode( LoadableSchemaObject description, String objectType ) { String byteCodeString = description.getBytecode(); if ( byteCodeString == null ) { String msg = I18n.err( I18n.ERR_16034_ENTRY_WITHOUT_VALID_AT, objectType, MetaSchemaConstants.M_BYTECODE_AT ); if ( LOG.isWarnEnabled() ) { LOG.warn( msg ); } throw new IllegalArgumentException( msg ); } byte[] bytecode = Base64.decode( byteCodeString.toCharArray() ); return new DefaultAttribute( MetaSchemaConstants.M_BYTECODE_AT, bytecode ); }
/** * Process the FQCN attribute * * @param description The Schema Object description * @param objectType The SchemaObject type * @return The SchemaObject FQCN */ private String getFqcn( LoadableSchemaObject description, String objectType ) { // The FQCN String mFqcn = description.getFqcn(); if ( mFqcn == null ) { String msg = I18n.err( I18n.ERR_16034_ENTRY_WITHOUT_VALID_AT, objectType, MetaSchemaConstants.M_FQCN_AT ); if ( LOG.isWarnEnabled() ) { LOG.warn( msg ); } throw new IllegalArgumentException( msg ); } return mFqcn; }
private SchemaObject copy( SchemaObject schemaObject ) { SchemaObject copy = null; if ( !( schemaObject instanceof LoadableSchemaObject ) ) { copy = schemaObject.copy(); } else { // Check the schemaObject here. if ( ( ( LoadableSchemaObject ) schemaObject ).isValid() ) { copy = schemaObject; } else { // We have an invalid SchemaObject, no need to go any further LdapUnwillingToPerformException error = new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, I18n.err( I18n.ERR_16079_INVALID_SCHEMA_OBJECT_CANNOT_BE_LOADED, schemaObject.getOid() ) ); errorHandler.handle( LOG, error.getMessage(), error ); } } return copy; }
/** * Stores some bytecode representing the compiled Java class for this * SchemaObject instance. * * @param bytecode The bytecode to store */ public void setBytecode( String bytecode ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_13700_CANNOT_MODIFY_LOCKED_SCHEMA_OBJECT, getName() ) ); } this.bytecode = bytecode; }
/** * Returns a String description of a schema. The resulting String format is : * <br> * (OID [DESC '<description>'] FQCN <fcqn> [BYTECODE <bytecode>] X-SCHEMA '<schema>') * <br> * @param description The description to transform to a String * @return The rendered schema object */ public static String render( LoadableSchemaObject description ) { StringBuilder buf = new StringBuilder(); buf.append( "( " ).append( description.getOid() ); if ( description.getDescription() != null ) { buf.append( " DESC " ); renderQDString( buf, description.getDescription() ); } buf.append( " FQCN " ).append( description.getFqcn() ); if ( !Strings.isEmpty( description.getBytecode() ) ) { buf.append( " BYTECODE " ).append( description.getBytecode() ); } buf.append( " X-SCHEMA '" ); buf.append( getSchemaName( description ) ); buf.append( "' )" ); return buf.toString(); }
/** * {@inheritDoc} */ @Override public boolean equals( Object o ) { if ( !super.equals( o ) ) { return false; } return o instanceof LdapComparator<?>; }
/** * Process the ByteCode attribute * * @param description The SchemaObject description * @param objectType The SchemaObject type * @return The Attribute containing the byteCode */ private Attribute getByteCode( LoadableSchemaObject description, String objectType ) { String byteCodeString = description.getBytecode(); if ( byteCodeString == null ) { String msg = I18n.err( I18n.ERR_16034_ENTRY_WITHOUT_VALID_AT, objectType, MetaSchemaConstants.M_BYTECODE_AT ); if ( LOG.isWarnEnabled() ) { LOG.warn( msg ); } throw new IllegalArgumentException( msg ); } byte[] bytecode = Base64.decode( byteCodeString.toCharArray() ); return new DefaultAttribute( MetaSchemaConstants.M_BYTECODE_AT, bytecode ); }
/** * Process the FQCN attribute * * @param description The Schema Object description * @param objectType The SchemaObject type * @return The SchemaObject FQCN */ private String getFqcn( LoadableSchemaObject description, String objectType ) { // The FQCN String mFqcn = description.getFqcn(); if ( mFqcn == null ) { String msg = I18n.err( I18n.ERR_16034_ENTRY_WITHOUT_VALID_AT, objectType, MetaSchemaConstants.M_FQCN_AT ); if ( LOG.isWarnEnabled() ) { LOG.warn( msg ); } throw new IllegalArgumentException( msg ); } return mFqcn; }
private SchemaObject copy( SchemaObject schemaObject ) { SchemaObject copy = null; if ( !( schemaObject instanceof LoadableSchemaObject ) ) { copy = schemaObject.copy(); } else { // Check the schemaObject here. if ( ( ( LoadableSchemaObject ) schemaObject ).isValid() ) { copy = schemaObject; } else { // We have an invalid SchemaObject, no need to go any further LdapUnwillingToPerformException error = new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, I18n.err( I18n.ERR_16079_INVALID_SCHEMA_OBJECT_CANNOT_BE_LOADED, schemaObject.getOid() ) ); errorHandler.handle( LOG, error.getMessage(), error ); } } return copy; }
/** * Set the Fully Qualified Class Name for this SchemaObject instance * class stored in the bytecode attribute * @param fqcn The Fully Qualified Class Name */ public void setFqcn( String fqcn ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_13700_CANNOT_MODIFY_LOCKED_SCHEMA_OBJECT, getName() ) ); } this.fqcn = fqcn; }
buf.append( schemaObject.getOid() ); buf.append( '\n' ); if ( schemaObject.getDescription() != null ) buf.append( schemaObject.getDescription() ); buf.append( '\n' ); if ( schemaObject.getFqcn() != null ) buf.append( schemaObject.getFqcn() ); buf.append( '\n' ); if ( schemaObject.getBytecode() != null ) if ( schemaObject.getBytecode().length() > 16 ) buf.append( schemaObject.getBytecode().substring( 0, 16 ) ); buf.append( schemaObject.getBytecode() ); if ( schemaObject.getExtensions() != null ) getExtensions( buf, schemaObject.getExtensions() );
/** * {@inheritDoc} */ @Override public boolean equals( Object o ) { if ( !super.equals( o ) ) { return false; } return o instanceof SyntaxChecker; }
/** * Set the Fully Qualified Class Name for this SchemaObject instance * class stored in the bytecode attribute * @param fqcn The Fully Qualified Class Name */ public void setFqcn( String fqcn ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_13700_CANNOT_MODIFY_LOCKED_SCHEMA_OBJECT, getName() ) ); } this.fqcn = fqcn; }