Java Code Examples for org.apache.activemq.artemis.api.core.SimpleString#subSeq()

The following examples show how to use org.apache.activemq.artemis.api.core.SimpleString#subSeq() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AMQPMessage.java    From activemq-artemis with Apache License 2.0 6 votes vote down vote up
@Override
public Object getObjectPropertyForFilter(SimpleString key) {
   if (key.startsWith(ANNOTATION_AREA_PREFIX)) {
      key = key.subSeq(ANNOTATION_AREA_PREFIX.length(), key.length());
      return getAnnotation(key);
   }

   Object value = getObjectProperty(key);
   if (value == null) {
      TypedProperties extra = getExtraProperties();
      if (extra != null) {
         value = extra.getProperty(key);
      }
   }
   return value;
}
 
Example 2
Source File: PacketImpl.java    From activemq-artemis with Apache License 2.0 5 votes vote down vote up
public SimpleString convertName(SimpleString name) {
   if (name == null) {
      return null;
   }

   if (name.startsWith(OLD_QUEUE_PREFIX)) {
      return name.subSeq(OLD_QUEUE_PREFIX.length(), name.length());
   } else if (name.startsWith(OLD_TOPIC_PREFIX)) {
      return name.subSeq(OLD_TOPIC_PREFIX.length(), name.length());
   } else {
      return name;
   }
}
 
Example 3
Source File: BucketMessageGroups.java    From activemq-artemis with Apache License 2.0 5 votes vote down vote up
private static Object retrieveBucketIntFromKey(SimpleString key) {
   SimpleString bucket = key.subSeq(_AMQ_GROUP_BUCKET_INT_KEY.length(), key.length());
   try {
      return Integer.parseInt(bucket.toString());
   } catch (NumberFormatException nfe) {
      return key;
   }
}
 
Example 4
Source File: ActiveMQCompatibleMessage.java    From activemq-artemis with Apache License 2.0 5 votes vote down vote up
protected static SimpleString checkPrefix1X(SimpleString address) {
   if (address != null) {
      if (address.startsWith(PacketImpl.OLD_QUEUE_PREFIX)) {
         return address.subSeq(PacketImpl.OLD_QUEUE_PREFIX.length(), address.length());
      } else if (address.startsWith(PacketImpl.OLD_TEMP_QUEUE_PREFIX)) {
         return address.subSeq(PacketImpl.OLD_TEMP_QUEUE_PREFIX.length(), address.length());
      } else if (address.startsWith(PacketImpl.OLD_TOPIC_PREFIX)) {
         return address.subSeq(PacketImpl.OLD_TOPIC_PREFIX.length(), address.length());
      } else if (address.startsWith(PacketImpl.OLD_TEMP_TOPIC_PREFIX)) {
         return address.subSeq(PacketImpl.OLD_TEMP_TOPIC_PREFIX.length(), address.length());
      }
   }

   return null;
}
 
Example 5
Source File: PrefixUtil.java    From activemq-artemis with Apache License 2.0 4 votes vote down vote up
public static SimpleString removePrefix(SimpleString string, SimpleString prefix) {
   return string.subSeq(prefix.length(), string.length());
}
 
Example 6
Source File: PrefixUtil.java    From activemq-artemis with Apache License 2.0 4 votes vote down vote up
public static SimpleString removeAddress(SimpleString string, SimpleString prefix) {
   return string.subSeq(0, prefix.length());
}