/** * Get the message written in the current locale. * * @return the message */ public String getMessageString() { return this.message.text(this.parameters); }
/** * {@inheritDoc} */ public XAResource getXAResource() { if (closed) throw new IllegalStateException(GraphI18n.closedConnectionMayNotBeUsed.text()); return this.original.getXAResource(); }
/** * {@inheritDoc} */ public boolean ping( long time, TimeUnit unit ) throws InterruptedException { if (closed) throw new IllegalStateException(GraphI18n.closedConnectionMayNotBeUsed.text()); return this.original.ping(time, unit); }
public static PropertyType discoverType( Object value ) { if (value == null) { throw new IllegalArgumentException(GraphI18n.unableToDiscoverPropertyTypeForNullValue.text()); } for (PropertyType type : PropertyType.values()) { if (type == OBJECT) continue; if (type.isTypeFor(value)) return type; } return OBJECT; }
/** * {@inheritDoc} */ public UUID create( Date value ) { throw new ValueFormatException(value, PropertyType.UUID, GraphI18n.unableToCreateValue.text(getPropertyType().getName(), Date.class.getSimpleName(), value)); }
/** * {@inheritDoc} */ public Name create( Path.Segment segment ) { if (segment == null) return null; // Can only convert if the path has no SNS index ... if (!segment.hasIndex()) return segment.getName(); throw new ValueFormatException(segment, getPropertyType(), GraphI18n.errorConvertingType.text(Path.Segment.class.getSimpleName(), Name.class.getSimpleName(), segment)); }
/** * {@inheritDoc} * * @see org.modeshape.graph.property.ValueFactory#create(java.util.UUID) */ public Long create( UUID value ) throws IoException { throw new ValueFormatException(value, getPropertyType(), GraphI18n.unableToCreateValue.text(getPropertyType().getName(), UUID.class.getSimpleName(), value)); }
/** * {@inheritDoc} */ public Name create( int value ) { throw new ValueFormatException(value, getPropertyType(), GraphI18n.unableToCreateValue.text(getPropertyType().getName(), Integer.class.getSimpleName(), value)); }
/** * {@inheritDoc} */ public Name create( boolean value ) { throw new ValueFormatException(value, getPropertyType(), GraphI18n.unableToCreateValue.text(getPropertyType().getName(), Boolean.class.getSimpleName(), value)); }
/** * {@inheritDoc} */ public DateTime create( Path value ) { throw new ValueFormatException(value, getPropertyType(), GraphI18n.unableToCreateValue.text(getPropertyType().getName(), Path.class.getSimpleName(), value)); }
/** * {@inheritDoc} */ public DateTime create( Path.Segment value ) { throw new ValueFormatException(value, getPropertyType(), GraphI18n.unableToCreateValue.text(getPropertyType().getName(), Path.Segment.class.getSimpleName(), value)); }
/** * {@inheritDoc} */ public URI create( Calendar value ) { throw new ValueFormatException(value, getPropertyType(), GraphI18n.unableToCreateValue.text(getPropertyType().getName(), Calendar.class.getSimpleName(), value)); }
/** * {@inheritDoc} * * @see org.modeshape.graph.property.ValueFactory#create(org.modeshape.graph.property.DateTime) */ public URI create( DateTime value ) throws ValueFormatException { throw new ValueFormatException(value, getPropertyType(), GraphI18n.unableToCreateValue.text(getPropertyType().getName(), DateTime.class.getSimpleName(), value)); }
/** * {@inheritDoc} */ public Boolean create( float value ) { throw new ValueFormatException(value, getPropertyType(), GraphI18n.unableToCreateValue.text(getPropertyType().getName(), Float.class.getSimpleName(), value)); }
/** * {@inheritDoc} */ public Boolean create( Path.Segment value ) { throw new ValueFormatException(value, getPropertyType(), GraphI18n.unableToCreateValue.text(getPropertyType().getName(), Path.Segment.class.getSimpleName(), value)); }
/** * {@inheritDoc} */ public Boolean create( Reference value ) { throw new ValueFormatException(value, getPropertyType(), GraphI18n.unableToCreateValue.text(getPropertyType().getName(), Reference.class.getSimpleName(), value)); }
/** * {@inheritDoc} */ public Path create( double value ) { throw new ValueFormatException(value, getPropertyType(), GraphI18n.unableToCreateValue.text(getPropertyType().getName(), Double.class.getSimpleName(), value)); }
/** * {@inheritDoc} */ public Reference create( Path value ) { throw new ValueFormatException(value, getPropertyType(), GraphI18n.unableToCreateValue.text(getPropertyType().getName(), Path.class.getSimpleName(), value)); }
protected WorkspaceType getWorkspace( Request request, String workspaceName ) { // Get the workspace for this request ... WorkspaceType workspace = repository.getWorkspace(txn, workspaceName); if (workspace == null) { String msg = GraphI18n.workspaceDoesNotExistInRepository.text(workspaceName, repository.getSourceName()); request.setError(new InvalidWorkspaceException(msg)); } return workspace; }
protected boolean updatesAllowed( Request request ) { if (!updatesAllowed) { request.setError(new InvalidRequestException(GraphI18n.sourceIsReadOnly.text(getSourceName()))); } return !request.hasError(); }